Use BoolVariable instead of EnumVariable for enable_lto
This commit is contained in:
parent
9de1f61924
commit
e4b95ae2fe
3 changed files with 4 additions and 4 deletions
|
@ -55,7 +55,7 @@ opts.AddVariables(
|
|||
('extra_flags_debug', 'Extra compiler and linker flags to use for debug builds', ""),
|
||||
('extra_flags_profile', 'Extra compiler and linker flags to use for profile builds', ""),
|
||||
('extra_flags_optimize', 'Extra compiler and linker flags to use for optimized builds', ""),
|
||||
EnumVariable('enable_lto', 'Whether to enable Link Time Optimization', "", ["", "yes", "no"]),
|
||||
BoolVariable('enable_lto', 'Whether to enable Link Time Optimization', False),
|
||||
PathVariable('bindir', 'Where to install binaries', "bin", PathVariable.PathAccept),
|
||||
('cachedir', 'Directory that contains a cache of derived files.', ''),
|
||||
PathVariable('datadir', 'read-only architecture-independent game data', "$datarootdir/$datadirname", PathVariable.PathAccept),
|
||||
|
@ -516,7 +516,7 @@ for env in [test_env, client_env, env]:
|
|||
else:
|
||||
env["ARCH"] = "-march=native"
|
||||
|
||||
if env["enable_lto"] == "yes":
|
||||
if env["enable_lto"] == True:
|
||||
env["HIGH_OPT_COMP_FLAGS"] = "-O3 " + env["ARCH"] + " -flto -s"
|
||||
env["HIGH_OPT_LINK_FLAGS"] = env["HIGH_OPT_COMP_FLAGS"] + " -fuse-ld=gold"
|
||||
else:
|
||||
|
|
|
@ -625,7 +625,7 @@ def error_action(target, source, env):
|
|||
raise UserError, "Target disabled because its prerequisites are not met"
|
||||
|
||||
def WesnothProgram(env, target, source, can_build, **kw):
|
||||
if env["build"] == "optimize" and env["enable_lto"] == "yes":
|
||||
if env["build"] == "optimize" and env["enable_lto"] == True:
|
||||
env["AR"] = 'gcc-ar'
|
||||
env["RANLIB"] = 'gcc-ranlib'
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ env_lua = env.Clone(
|
|||
CPPPATH = ["$CPPPATH", Dir(".").srcnode()],
|
||||
CPPDEFINES = ["$CPPDEFINES", env["PLATFORM"] != "win32" and "LUA_USE_POSIX" or []])
|
||||
|
||||
if env_lua["build"] == "optimize" and env_lua["enable_lto"] == "yes":
|
||||
if env_lua["build"] == "optimize" and env_lua["enable_lto"] == True:
|
||||
env_lua["AR"] = 'gcc-ar'
|
||||
env_lua["RANLIB"] = 'gcc-ranlib'
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue