From 5832589eca03f2c0b31a5360c5be4e07a2939e47 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Tue, 10 Sep 2024 04:34:31 -0400 Subject: [PATCH] adjustment to sh scripts --- scripts/build_sokol_demo.ps1 | 4 ++-- scripts/build_sokol_demo.sh | 42 ++++++++++++++++++---------------- scripts/build_sokol_library.sh | 4 ++-- 3 files changed, 26 insertions(+), 24 deletions(-) diff --git a/scripts/build_sokol_demo.ps1 b/scripts/build_sokol_demo.ps1 index 8126757..9c035dc 100644 --- a/scripts/build_sokol_demo.ps1 +++ b/scripts/build_sokol_demo.ps1 @@ -96,8 +96,8 @@ function build-SokolBackendDemo $build_args += $flag_thread_count + $CoreCount_Physical # $build_args += $flag_optimize_none # $build_args += $flag_optimize_minimal - $build_args += $flag_optimize_speed - # $build_args += $falg_optimize_aggressive + # $build_args += $flag_optimize_speed + $build_args += $falg_optimize_aggressive # $build_args += $flag_debug $build_args += $flag_pdb_name + $pdb $build_args += $flag_subsystem + 'windows' diff --git a/scripts/build_sokol_demo.sh b/scripts/build_sokol_demo.sh index 571d7c6..a925e17 100644 --- a/scripts/build_sokol_demo.sh +++ b/scripts/build_sokol_demo.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e + # Source the misc.sh script source "$(dirname "$0")/helpers/misc.sh" @@ -17,9 +19,8 @@ verify_path "$path_thirdparty" # CPU Info path_system_details="$path_build/system_details.ini" if [ -f "$path_system_details" ]; then - source "$path_system_details" - CoreCount_Physical=$PhysicalCores - CoreCount_Logical=$LogicalCores + CoreCount_Physical=$(grep "PhysicalCores" "$path_system_details" | cut -d'=' -f2) + CoreCount_Logical=$(grep "LogicalCores" "$path_system_details" | cut -d'=' -f2) else CoreCount_Physical=$(nproc --all) CoreCount_Logical=$(nproc) @@ -49,16 +50,12 @@ update_git_repo "$path_sokol" "$url_sokol" "$sokol_build_clibs_command" update_git_repo "$path_harfbuzz" "$url_harfbuzz" "./scripts/build.sh" pushd "$path_thirdparty" > /dev/null - path_sokol_dlls="$path_sokol" - path_harfbuzz_dlls="$path_harfbuzz/lib/linux" - - for dll in "$path_sokol_dlls"/*.so; do - cp "$dll" "$path_build/" - done - - for dll in "$path_harfbuzz_dlls"/*.so; do - cp "$dll" "$path_build/" - done + path_harfbuzz_dlls="$path_harfbuzz/lib/linux64" + if ls "$path_harfbuzz_dlls"/*.so 1> /dev/null 2>&1; then + cp "$path_harfbuzz_dlls"/*.so "$path_build/" + else + echo "Warning: No .so files found in $path_harfbuzz_dlls" + fi popd > /dev/null # Source the odin compiler definitions @@ -67,19 +64,24 @@ source "$(dirname "$0")/helpers/odin_compiler_defs.sh" pkg_collection_backend="backend=$path_backend" pkg_collection_thirdparty="thirdparty=$path_thirdparty" -pushd "$path_examples" > /dev/null +pushd "$path_build" > /dev/null function build_SokolBackendDemo { echo 'Building VEFontCache: Sokol Backend Demo' - # $compile_shaders="$path_scripts/compile_sokol_shaders.sh" - # bash "$compile_shaders" + # Uncomment the following lines if you need to compile shaders + compile_shaders="$path_scripts/compile_sokol_shaders.sh" + if [ -f "$compile_shaders" ]; then + bash "$compile_shaders" + else + echo "Warning: $compile_shaders not found. Skipping shader compilation." + fi executable="$path_build/sokol_demo" build_args=( "$command_build" - "./sokol_demo" + "../examples/sokol_demo" "$flag_output_path$executable" "${flag_collection}${pkg_collection_backend}" "${flag_collection}${pkg_collection_thirdparty}" @@ -88,8 +90,8 @@ function build_SokolBackendDemo { "${flag_thread_count}${CoreCount_Physical}" # "$flag_optimize_none" # "$flag_optimize_minimal" - # "$flag_optimize_speed" - "$flag_optimize_aggressive" + "$flag_optimize_speed" + # "$flag_optimize_aggressive" # "$flag_debug" "$flag_show_timings" # "$flag_show_system_call" @@ -106,4 +108,4 @@ function build_SokolBackendDemo { build_SokolBackendDemo -popd > /dev/null \ No newline at end of file +popd > /dev/null diff --git a/scripts/build_sokol_library.sh b/scripts/build_sokol_library.sh index ba77dea..b53c983 100644 --- a/scripts/build_sokol_library.sh +++ b/scripts/build_sokol_library.sh @@ -15,7 +15,7 @@ if [ -d "$path_sokol" ] && [ -d "$path_sokol/sokol" ]; then rm -rf "$path_sokol_examples" fi -pushd "$path_sokol" > /dev/null +# pushd "$path_sokol" # Convert build_clibs_linux.sh to Unix line endings if command -v dos2unix &> /dev/null; then @@ -50,4 +50,4 @@ check_and_install() { # Run the build script ./build_clibs_linux.sh -popd > /dev/null +# popd