1
0
forked from mirrors/0ad

Check for WX in premake and rename atlas option

The option --atlas is oddly different than any other feature flag,
change it to be in line with the others and enable it by default. The
new option is --without-atlas.

As the WX binaries aren't precompiled for Windows automagically disable
atlas there for users running the batchfile through filemanger if WX is
missing.

On *nix not providing a valid wx-config whith enabled atlas is
considered an error.

Fixes: #6401
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
Ralph Sennhauser
2024-12-14 08:00:14 +01:00
parent c09d12a959
commit 949d5f8c0b
5 changed files with 31 additions and 29 deletions
+3 -19
View File
@@ -20,36 +20,20 @@ cd "$(dirname "$0")" || die
premake_args=""
with_system_premake5=false
enable_atlas=true
for i in "$@"; do
case $i in
--with-system-premake5) with_system_premake5=true ;;
--enable-atlas) enable_atlas=true ;;
--disable-atlas) enable_atlas=false ;;
# Assume any other --options are for Premake
--*) premake_args="${premake_args} $i" ;;
esac
done
if [ "$enable_atlas" = "true" ]; then
premake_args="${premake_args} --atlas"
if [ "$OS" = "Darwin" ]; then
# Provide path to wx-config on OS X (as wxwidgets doesn't support pkgconfig)
export WX_CONFIG="${WX_CONFIG:="$(pwd)/../../libraries/macos/wxwidgets/bin/wx-config"}"
else
export WX_CONFIG="${WX_CONFIG:="wx-config"}"
fi
if [ ! -x "$(command -v "$WX_CONFIG")" ]; then
echo 'WX_CONFIG must be set and valid or wx-config must be present when --atlas is passed as argument.'
exit 1
fi
fi
if [ "$OS" = "Darwin" ]; then
# Set minimal SDK version
export MIN_OSX_VERSION="${MIN_OSX_VERSION:="10.12"}"
: "${MIN_OSX_VERSION:=10.12}"
: "${WX_CONFIG:=$(realpath ../../libraries/macos/wxwidgets/bin/wx-config)}"
export MIN_OSX_VERSION WX_CONFIG
fi
# Now build Premake or use system's.