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:
@@ -68,7 +68,7 @@ pipeline {
|
||||
bat "cd libraries && get-windows-libs.bat"
|
||||
bat "(robocopy E:\\wxWidgets-3.2.6\\lib libraries\\win32\\wxwidgets\\lib /MIR /NDL /NJH /NJS /NP /NS /NC) ^& IF %ERRORLEVEL% LEQ 1 exit 0"
|
||||
bat "(robocopy E:\\wxWidgets-3.2.6\\include libraries\\win32\\wxwidgets\\include /MIR /NDL /NJH /NJS /NP /NS /NC) ^& IF %ERRORLEVEL% LEQ 1 exit 0"
|
||||
bat "cd build\\workspaces && update-workspaces.bat --atlas --without-pch --without-tests"
|
||||
bat "cd build\\workspaces && update-workspaces.bat --without-pch --without-tests"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ pipeline {
|
||||
bat "cd libraries && get-windows-libs.bat"
|
||||
bat "(robocopy /MIR /NDL /NJH /NJS /NP /NS /NC E:\\wxWidgets-3.2.6\\lib libraries\\win32\\wxwidgets\\lib) ^& IF %ERRORLEVEL% LEQ 1 exit 0"
|
||||
bat "(robocopy /MIR /NDL /NJH /NJS /NP /NS /NC E:\\wxWidgets-3.2.6\\include libraries\\win32\\wxwidgets\\include) ^& IF %ERRORLEVEL% LEQ 1 exit 0"
|
||||
bat "cd build\\workspaces && update-workspaces.bat --atlas --jenkins-tests"
|
||||
bat "cd build\\workspaces && update-workspaces.bat --jenkins-tests"
|
||||
|
||||
script {
|
||||
if (params.CLEANBUILD) {
|
||||
|
||||
@@ -59,6 +59,17 @@ local function add_third_party_include_paths(extern_lib)
|
||||
end
|
||||
end
|
||||
|
||||
local function wx_config_path()
|
||||
local wx_config = os.getenv("WX_CONFIG") or "wx-config"
|
||||
local _, error_code = os.outputof("command -v " .. wx_config)
|
||||
if error_code ~= 0 then
|
||||
print("WX_CONFIG must be set and valid or wx-config must be present when atlas is enabled")
|
||||
print("current value: " .. wx_config)
|
||||
os.exit(1)
|
||||
end
|
||||
return wx_config
|
||||
end
|
||||
|
||||
pkgconfig = require "pkgconfig"
|
||||
|
||||
-- Configure pkgconfig for MacOSX systems
|
||||
@@ -727,16 +738,14 @@ extern_lib_defs = {
|
||||
else
|
||||
-- wxwidgets does not come with a definition file for pkg-config,
|
||||
-- so we have to use wxwidgets' own config tool
|
||||
wx_config_path = os.getenv("WX_CONFIG") or "wx-config"
|
||||
pkgconfig.add_includes(nil, wx_config_path, "--unicode=yes --cxxflags")
|
||||
pkgconfig.add_includes(nil, wx_config_path(), "--unicode=yes --cxxflags")
|
||||
end
|
||||
end,
|
||||
link_settings = function()
|
||||
if os.istarget("windows") then
|
||||
libdirs { libraries_dir.."wxwidgets/lib/vc_lib" }
|
||||
else
|
||||
wx_config_path = os.getenv("WX_CONFIG") or "wx-config"
|
||||
pkgconfig.add_links(nil, wx_config_path, "--unicode=yes --libs std,gl")
|
||||
pkgconfig.add_links(nil, wx_config_path(), "--unicode=yes --libs std,gl")
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
newoption { trigger = "android", description = "Use non-working Android cross-compiling mode" }
|
||||
newoption { trigger = "atlas", description = "Include Atlas scenario editor projects" }
|
||||
newoption { trigger = "coverage", description = "Enable code coverage data collection (GCC only)" }
|
||||
newoption { trigger = "gles", description = "Use non-working OpenGL ES 2.0 mode" }
|
||||
newoption { trigger = "icc", description = "Use Intel C++ Compiler (Linux only; should use either \"--cc icc\" or --without-pch too, and then set CXX=icpc before calling make)" }
|
||||
@@ -12,6 +11,7 @@ newoption { trigger = "with-system-mozjs", description = "Search standard paths
|
||||
newoption { trigger = "with-system-nvtt", description = "Search standard paths for nvidia-texture-tools library, instead of using bundled copy" }
|
||||
newoption { trigger = "with-valgrind", description = "Enable Valgrind support (non-Windows only)" }
|
||||
newoption { trigger = "without-audio", description = "Disable use of OpenAL/Ogg/Vorbis APIs" }
|
||||
newoption { trigger = "without-atlas", description = "Disable Atlas scenario/map editor and ActorEditor" }
|
||||
newoption { trigger = "without-lobby", description = "Disable the use of gloox and the multiplayer lobby" }
|
||||
newoption { trigger = "without-miniupnpc", description = "Disable use of miniupnpc for port forwarding" }
|
||||
newoption { trigger = "without-nvtt", description = "Disable use of NVTT" }
|
||||
@@ -33,6 +33,15 @@ if _ACTION == "gmake" then
|
||||
os.exit(1)
|
||||
end
|
||||
|
||||
-- On Windows check if wxWidgets is available, if not disable atlas and emit warning.
|
||||
-- This is because there are currently not prebuilt binaries provided.
|
||||
if not _OPTIONS["without-atlas"] and os.istarget("windows") then
|
||||
if not os.isfile("../../libraries/win32/wxwidgets/include/wx/wx.h") then
|
||||
print("wxWidgets not found, disableing atlas")
|
||||
_OPTIONS["without-atlas"] = ""
|
||||
end
|
||||
end
|
||||
|
||||
-- Root directory of project checkout relative to this .lua file
|
||||
rootdir = "../.."
|
||||
|
||||
@@ -1439,7 +1448,7 @@ function setup_tests()
|
||||
-- Don't include sysdep tests on the wrong sys
|
||||
-- Don't include Atlas tests unless Atlas is being built
|
||||
if not (string.find(v, "/sysdep/os/win/") and not os.istarget("windows")) and
|
||||
not (string.find(v, "/tools/atlas/") and not _OPTIONS["atlas"]) and
|
||||
not (string.find(v, "/tools/atlas/") and _OPTIONS["without-atlas"]) and
|
||||
not (string.find(v, "/sysdep/arch/x86_x64/") and ((arch ~= "amd64") or (arch ~= "x86")))
|
||||
then
|
||||
table.insert(test_files, v)
|
||||
@@ -1460,7 +1469,7 @@ function setup_tests()
|
||||
filter { }
|
||||
|
||||
links { "mocks_test" }
|
||||
if _OPTIONS["atlas"] then
|
||||
if not _OPTIONS["without-atlas"] then
|
||||
links { "AtlasObject" }
|
||||
end
|
||||
extra_params = {
|
||||
@@ -1554,7 +1563,7 @@ project("pyrogenesis") -- Set the main project active
|
||||
links { static_lib_names_release }
|
||||
filter { }
|
||||
|
||||
if _OPTIONS["atlas"] then
|
||||
if not _OPTIONS["without-atlas"] then
|
||||
setup_atlas_projects()
|
||||
setup_atlas_frontends()
|
||||
end
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user