Strip release builds

Signed-off-by: somebody_master <somebody_master@somebodyserver.mooo.com>
This commit is contained in:
Somebody Master 2023-02-21 13:41:02 +01:00
parent 901c4a3143
commit d60e3eafc7
Signed by: somebody_master
GPG Key ID: 78315CFDF0B25505

View File

@ -4,15 +4,17 @@ export ANDROID_NDK_ROOT="$HOME/.android-sdk/ndk/23.2.8568313"
# Folders
_build_folder="gdextension"
_bin_folder="build"
# Error variables
_error_build_folder="${_build_folder} doesn't exist"
_error_bin_folder="${_bin_folder} doesn't exist"
_error_no_option="\nYou have to indicate a valid option"
# Platform variables
_platform_linux="platform=linux"
_platform_windows="platform=windows"
_platform_android="platform=android"
_platform_linux="linux"
_platform_windows="windows"
_platform_android="android"
# Clean variables and exit
function clean_exit() {
@ -28,8 +30,10 @@ function clean_exit() {
unset _error_no_option
unset _error_build_folder
unset _error_bin_folder
unset _build_folder
unset _bin_folder
unset ANDROID_NDK_ROOT
exit "$1"
@ -38,19 +42,26 @@ function clean_exit() {
# Clean compilations
function clean() {
cd "$_build_folder" || clean_exit 1 "$_error_build_folder"
scons "$_platform_linux" --clean
scons "$_platform_windows" --clean
scons "$_platform_android" --clean
scons "platform=$_platform_linux" --clean
scons "platform=$_platform_windows" --clean
scons "platform=$_platform_android" --clean
cd ..
}
# Build by passing the platform as a variable
function build() {
cd "$_build_folder" || clean_exit 1 "$_error_build_folder"
scons "$1" target=template_release
scons "$1" target=template_debug
unset 1
scons "platform=$1" target=template_release
scons "platform=$1" target=template_debug
cd ..
if [ "$1" != "$_platform_android" ]; then
cd "$_bin_folder" || clean_exit 1 "$_error_bin_folder"
strip ./*.$1.template_release.*.*
cd ..
fi
unset 1
}
# Analize build process to create compile_commands.json