Bump premake to version 5.0.0-beta6

This makes 5.0.0-beta5 the minimally supported version as the gmake2
action was renamed to gmake while gmake was renamed to gmakelegacy. So
from now on gmake action is to be used.

Clear out all old version dependent code.

Fixes: #7789
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
Ralph Sennhauser 2025-02-19 20:07:09 +01:00
parent f1d577be62
commit 638c04987e
No known key found for this signature in database
7 changed files with 31 additions and 83 deletions

View file

@ -41,7 +41,7 @@ function m.init(have_std, have_eh, runner, includes, root_includes)
-- With gmake, create a Utility project that generates the test root file
-- This is a workaround for https://github.com/premake/premake-core/issues/286
if _ACTION == "gmake2" then
if _ACTION == "gmake" then
project "cxxtestroot"
kind "Makefile"
@ -64,7 +64,7 @@ function m.configure_project(hdrfiles)
-- Generate the root file, or make sure the utility for generating
-- it is a dependancy with gmake.
if _ACTION == "gmake2" then
if _ACTION == "gmake" then
dependson { "cxxtestroot" }
else
prebuildmessage 'Generating test root file'
@ -92,7 +92,7 @@ function m.configure_project(hdrfiles)
-- Add source files
files { "%{wks.location}/generated/test_root.cpp" }
if not (_ACTION == "gmake2") then
if not (_ACTION == "gmake") then
for _,hdrfile in ipairs(hdrfiles) do
local srcfile = "%{wks.location}/generated/".. path.getbasename(hdrfile) .. ".cpp"
files { srcfile }

View file

@ -38,33 +38,15 @@ local function add_source_lib_paths(extern_lib)
end
local function add_default_include_paths(extern_lib)
-- As of premake5-beta2, `sysincludedirs` has been deprecated in favour of
-- `externalincludedirs`, and continuing to use it causes warnings to be emitted.
--
-- We use `externalincludedirs` when available to prevent the warnings, falling back
-- to `sysincludedirs` when not to prevent breakage of the `--with-system-premake5`
-- build argument.
if externalincludedirs then
externalincludedirs { libraries_dir .. extern_lib .. "/include" }
else
sysincludedirs { libraries_dir .. extern_lib .. "/include" }
end
externalincludedirs { libraries_dir .. extern_lib .. "/include" }
end
local function add_source_include_paths(extern_lib)
if externalincludedirs then
externalincludedirs { libraries_source_dir .. extern_lib .. "/include" }
else
sysincludedirs { libraries_source_dir .. extern_lib .. "/include" }
end
externalincludedirs { libraries_source_dir .. extern_lib .. "/include" }
end
local function add_third_party_include_paths(extern_lib)
if externalincludedirs then
externalincludedirs { third_party_source_dir .. extern_lib .. "/include" }
else
sysincludedirs { third_party_source_dir .. extern_lib .. "/include" }
end
externalincludedirs { third_party_source_dir .. extern_lib .. "/include" }
end
local function wx_config_path()
@ -239,11 +221,7 @@ extern_lib_defs = {
end
-- TODO: This actually applies to most libraries we use on BSDs, make this a global setting.
if os.istarget("bsd") then
if externalincludedirs then
externalincludedirs { "/usr/local/include" }
else
sysincludedirs { "/usr/local/include" }
end
externalincludedirs { "/usr/local/include" }
end
end,
link_settings = function()
@ -274,11 +252,7 @@ extern_lib_defs = {
cxxtest = {
compile_settings = function()
if not _OPTIONS["with-system-cxxtest"] then
if externalincludedirs then
externalincludedirs { libraries_source_dir .. "cxxtest-4.4" }
else
sysincludedirs { libraries_source_dir .. "cxxtest-4.4" }
end
externalincludedirs { libraries_source_dir .. "cxxtest-4.4" }
-- Upstream uses WIN32 instead of _WIN32 define
if os.istarget("windows") then
defines { "WIN32" }
@ -658,18 +632,10 @@ extern_lib_defs = {
end
else
filter "Debug"
if externalincludedirs then
externalincludedirs { libraries_source_dir.."spidermonkey/include-debug" }
else
sysincludedirs { libraries_source_dir.."spidermonkey/include-debug" }
end
externalincludedirs { libraries_source_dir.."spidermonkey/include-debug" }
defines { "DEBUG" }
filter "Release"
if externalincludedirs then
externalincludedirs { libraries_source_dir.."spidermonkey/include-release" }
else
sysincludedirs { libraries_source_dir.."spidermonkey/include-release" }
end
externalincludedirs { libraries_source_dir.."spidermonkey/include-release" }
filter { }
end
end,

View file

@ -47,33 +47,17 @@ end
function m.add_includes(lib, alternative_cmd, alternative_flags)
local dirs, files, options = parse_pkg_config_includes(lib, alternative_cmd, alternative_flags)
-- As of premake5-beta2, `sysincludedirs` has been deprecated in favour of
-- `externalincludedirs`, and continuing to use it causes warnings to be emitted.
-- We use `externalincludedirs` when available to prevent the warnings, falling back
-- to `sysincludedirs` when not to prevent breakage of the `--with-system-premake5`
-- build argument.
if externalincludedirs then
externalincludedirs(dirs)
else
sysincludedirs(dirs)
end
externalincludedirs(dirs)
forceincludes(files)
buildoptions(options)
end
function m.add_includes_after(lib, alternative_cmd, alternative_flags)
-- Support for includedirsafter was added after the 5.0.0-beta2 release.
-- Fall back if unavailable to support `--with-system-premake5`
if includedirsafter then
local dirs, files, options = parse_pkg_config_includes(lib, alternative_cmd, alternative_flags)
local dirs, files, options = parse_pkg_config_includes(lib, alternative_cmd, alternative_flags)
includedirsafter(dirs)
forceincludes(files)
buildoptions(options)
else
m.add_includes(lib, alternative_cmd, alternative_flags)
end
includedirsafter(dirs)
forceincludes(files)
buildoptions(options)
end
function m.add_links(lib, alternative_cmd, alternative_flags)

View file

@ -1,3 +1,12 @@
local semver = require("semver")
if (semver("5.0.0-beta5") <= semver(_PREMAKE_VERSION)) then
print("Using premake " .. _PREMAKE_VERSION .. "...")
else
print("Requires Premake 5.0.0-beta5 or later")
os.exit(1)
end
newoption { category = "Pyrogenesis", trigger = "android", description = "Use non-working Android cross-compiling mode" }
newoption { category = "Pyrogenesis", trigger = "coverage", description = "Enable code coverage data collection (GCC only)" }
newoption { category = "Pyrogenesis", trigger = "gles", description = "Use non-working OpenGL ES 2.0 mode" }
@ -30,12 +39,6 @@ newoption { category = "Pyrogenesis", trigger = "bindir", description = "Directo
newoption { category = "Pyrogenesis", trigger = "datadir", description = "Directory for data files (typically '/usr/share/games/0ad'); default is ../data/ relative to executable" }
newoption { category = "Pyrogenesis", trigger = "libdir", description = "Directory for libraries (typically '/usr/lib/games/0ad'); default is ./ relative to executable" }
if _ACTION == "gmake" then
print("Premake action 'gmake' is no longer supported by pyrogenesis, use 'gmake2'")
print("Example: 'premake5 --file=build/premake/premake5.lua gmake2'")
os.exit(1)
end
-- Root directory of project checkout relative to this .lua file
rootdir = "../.."
@ -227,12 +230,7 @@ function project_set_build_flags()
optimize "Speed"
end
if _OPTIONS["with-lto"] then
if linktimeoptimization then
linktimeoptimization("On")
else
-- deprecated since v5.0.0-beta4
flags { "LinkTimeOptimization" }
end
linktimeoptimization("On")
end
defines { "NDEBUG", "CONFIG_FINAL=1" }
@ -433,7 +431,7 @@ function project_set_build_flags()
end
-- Adding the executable path and taking care of correct escaping
if _ACTION == "gmake2" then
if _ACTION == "gmake" then
linkoptions { "-Wl,-rpath,'$$ORIGIN'" }
elseif _ACTION == "codeblocks" then
linkoptions { "-Wl,-R\\\\$$$ORIGIN" }

View file

@ -48,10 +48,10 @@ export HOSTTYPE="$HOSTTYPE"
echo "Premake args: ${premake_args}"
if [ "$OS" != "Darwin" ]; then
# shellcheck disable=SC2086
${premake_command} --file="premake5.lua" --outpath="../workspaces/gcc/" ${premake_args} gmake2 || die "Premake failed"
${premake_command} --file="premake5.lua" --outpath="../workspaces/gcc/" ${premake_args} gmake || die "Premake failed"
else
# shellcheck disable=SC2086
${premake_command} --file="premake5.lua" --outpath="../workspaces/gcc/" --macosx-version-min="${MIN_OSX_VERSION}" ${premake_args} gmake2 || die "Premake failed"
${premake_command} --file="premake5.lua" --outpath="../workspaces/gcc/" --macosx-version-min="${MIN_OSX_VERSION}" ${premake_args} gmake || die "Premake failed"
# Also generate xcode workspaces if on OS X
# shellcheck disable=SC2086
${premake_command} --file="premake5.lua" --outpath="../workspaces/xcode4" --macosx-version-min="${MIN_OSX_VERSION}" ${premake_args} xcode4 || die "Premake failed"

View file

@ -4,7 +4,7 @@ cd /D "%~dp0"
rem **SVN revision to checkout for windows-libs or windows-libs-amd64**
rem **Update this line when you commit an update to windows-libs or windows-libs-amd64**
set "svnrev=28260"
set "svnrev=28261"
if "%1" == "--amd64" (
set "LIBS_PATH=win64"

View file

@ -8,8 +8,8 @@ set -e
cd "$(dirname "$0")"
PV=5.0.0-beta4
LIB_VERSION=${PV}+wfg1
PV=5.0.0-beta6
LIB_VERSION=${PV}+wfg0
fetch()
{