adjustment to sh scripts

This commit is contained in:
2024-09-10 04:34:31 -04:00
parent 15b8291131
commit 5832589eca
3 changed files with 26 additions and 24 deletions

View File

@@ -96,8 +96,8 @@ function build-SokolBackendDemo
$build_args += $flag_thread_count + $CoreCount_Physical $build_args += $flag_thread_count + $CoreCount_Physical
# $build_args += $flag_optimize_none # $build_args += $flag_optimize_none
# $build_args += $flag_optimize_minimal # $build_args += $flag_optimize_minimal
$build_args += $flag_optimize_speed # $build_args += $flag_optimize_speed
# $build_args += $falg_optimize_aggressive $build_args += $falg_optimize_aggressive
# $build_args += $flag_debug # $build_args += $flag_debug
$build_args += $flag_pdb_name + $pdb $build_args += $flag_pdb_name + $pdb
$build_args += $flag_subsystem + 'windows' $build_args += $flag_subsystem + 'windows'

View File

@@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
set -e
# Source the misc.sh script # Source the misc.sh script
source "$(dirname "$0")/helpers/misc.sh" source "$(dirname "$0")/helpers/misc.sh"
@@ -17,9 +19,8 @@ verify_path "$path_thirdparty"
# CPU Info # CPU Info
path_system_details="$path_build/system_details.ini" path_system_details="$path_build/system_details.ini"
if [ -f "$path_system_details" ]; then if [ -f "$path_system_details" ]; then
source "$path_system_details" CoreCount_Physical=$(grep "PhysicalCores" "$path_system_details" | cut -d'=' -f2)
CoreCount_Physical=$PhysicalCores CoreCount_Logical=$(grep "LogicalCores" "$path_system_details" | cut -d'=' -f2)
CoreCount_Logical=$LogicalCores
else else
CoreCount_Physical=$(nproc --all) CoreCount_Physical=$(nproc --all)
CoreCount_Logical=$(nproc) 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" update_git_repo "$path_harfbuzz" "$url_harfbuzz" "./scripts/build.sh"
pushd "$path_thirdparty" > /dev/null pushd "$path_thirdparty" > /dev/null
path_sokol_dlls="$path_sokol" path_harfbuzz_dlls="$path_harfbuzz/lib/linux64"
path_harfbuzz_dlls="$path_harfbuzz/lib/linux" if ls "$path_harfbuzz_dlls"/*.so 1> /dev/null 2>&1; then
cp "$path_harfbuzz_dlls"/*.so "$path_build/"
for dll in "$path_sokol_dlls"/*.so; do else
cp "$dll" "$path_build/" echo "Warning: No .so files found in $path_harfbuzz_dlls"
done fi
for dll in "$path_harfbuzz_dlls"/*.so; do
cp "$dll" "$path_build/"
done
popd > /dev/null popd > /dev/null
# Source the odin compiler definitions # 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_backend="backend=$path_backend"
pkg_collection_thirdparty="thirdparty=$path_thirdparty" pkg_collection_thirdparty="thirdparty=$path_thirdparty"
pushd "$path_examples" > /dev/null pushd "$path_build" > /dev/null
function build_SokolBackendDemo { function build_SokolBackendDemo {
echo 'Building VEFontCache: Sokol Backend Demo' echo 'Building VEFontCache: Sokol Backend Demo'
# $compile_shaders="$path_scripts/compile_sokol_shaders.sh" # Uncomment the following lines if you need to compile shaders
# bash "$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" executable="$path_build/sokol_demo"
build_args=( build_args=(
"$command_build" "$command_build"
"./sokol_demo" "../examples/sokol_demo"
"$flag_output_path$executable" "$flag_output_path$executable"
"${flag_collection}${pkg_collection_backend}" "${flag_collection}${pkg_collection_backend}"
"${flag_collection}${pkg_collection_thirdparty}" "${flag_collection}${pkg_collection_thirdparty}"
@@ -88,8 +90,8 @@ function build_SokolBackendDemo {
"${flag_thread_count}${CoreCount_Physical}" "${flag_thread_count}${CoreCount_Physical}"
# "$flag_optimize_none" # "$flag_optimize_none"
# "$flag_optimize_minimal" # "$flag_optimize_minimal"
# "$flag_optimize_speed" "$flag_optimize_speed"
"$flag_optimize_aggressive" # "$flag_optimize_aggressive"
# "$flag_debug" # "$flag_debug"
"$flag_show_timings" "$flag_show_timings"
# "$flag_show_system_call" # "$flag_show_system_call"
@@ -106,4 +108,4 @@ function build_SokolBackendDemo {
build_SokolBackendDemo build_SokolBackendDemo
popd > /dev/null popd > /dev/null

View File

@@ -15,7 +15,7 @@ if [ -d "$path_sokol" ] && [ -d "$path_sokol/sokol" ]; then
rm -rf "$path_sokol_examples" rm -rf "$path_sokol_examples"
fi fi
pushd "$path_sokol" > /dev/null # pushd "$path_sokol"
# Convert build_clibs_linux.sh to Unix line endings # Convert build_clibs_linux.sh to Unix line endings
if command -v dos2unix &> /dev/null; then if command -v dos2unix &> /dev/null; then
@@ -50,4 +50,4 @@ check_and_install() {
# Run the build script # Run the build script
./build_clibs_linux.sh ./build_clibs_linux.sh
popd > /dev/null # popd