mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-28 01:33:55 +00:00
Refactored build variants implementation.
This commit is contained in:
parent
31f3b42b2e
commit
1db72bff99
18
SConstruct
18
SConstruct
@ -289,22 +289,18 @@ SConscript(dirs = Split("po doc packaging/windows"))
|
|||||||
|
|
||||||
binaries = Split("wesnoth wesnoth_editor wesnothd cutter exploder campaignd test")
|
binaries = Split("wesnoth wesnoth_editor wesnothd cutter exploder campaignd test")
|
||||||
builds = {
|
builds = {
|
||||||
"debug" : Split("-O0 -DDEBUG -ggdb3 -W -Wall -ansi"),
|
"debug" : dict(CXXFLAGS = Split("-O0 -DDEBUG -ggdb3 -W -Wall -ansi")),
|
||||||
"release" : Split("-O2 -ansi"),
|
"release" : dict(CXXFLAGS = Split("-O2 -ansi")),
|
||||||
"profile" : "-pg"
|
"profile" : dict(CXXFLAGS = "-pg", LINKFLAGS = "-pg")
|
||||||
}
|
}
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
builds["release"] = [] # Both -O2 and -ansi cause Bad Things to happen on windows
|
builds["release"] = {} # Both -O2 and -ansi cause Bad Things to happen on windows
|
||||||
build = env["build"]
|
build = env["build"]
|
||||||
env.AppendUnique(CXXFLAGS = builds[build])
|
|
||||||
if build == "profile": env.AppendUnique(LINKFLAGS = "-pg")
|
|
||||||
if 'CXXFLAGS' in os.environ:
|
|
||||||
env.Append(CXXFLAGS = os.environ['CXXFLAGS'])
|
|
||||||
|
|
||||||
if 'LDFLAGS' in os.environ:
|
|
||||||
env.Append(LINKFLAGS = os.environ['LDFLAGS'])
|
|
||||||
|
|
||||||
|
env.AppendUnique(**builds[build])
|
||||||
|
env.Append(CXXFLAGS = os.environ.get('CXXFLAGS', []), LINKFLAGS = os.environ.get('LDFLAGS', []))
|
||||||
env.MergeFlags(env["extra_flags_" + build])
|
env.MergeFlags(env["extra_flags_" + build])
|
||||||
|
|
||||||
SConscript("src/SConscript", build_dir = os.path.join("build", build), exports = "env")
|
SConscript("src/SConscript", build_dir = os.path.join("build", build), exports = "env")
|
||||||
Import(binaries + ["sources"])
|
Import(binaries + ["sources"])
|
||||||
binary_nodes = map(eval, binaries)
|
binary_nodes = map(eval, binaries)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user