SCons recipe: fixed TAGS and test targets.

This commit is contained in:
Sergey Popov 2008-05-25 11:11:05 +00:00
parent 4d0673ca4f
commit 308321095d
2 changed files with 9 additions and 5 deletions

View file

@ -290,7 +290,7 @@ except:
Export(Split("env have_client_prereqs have_X have_server_prereqs"))
SConscript(dirs = Split("po doc packaging/windows"))
binaries = Split("wesnoth wesnoth_editor wesnothd cutter exploder campaignd")
binaries = Split("wesnoth wesnoth_editor wesnothd cutter exploder campaignd test")
builds = {
"debug" : Split("-O0 -DDEBUG -ggdb3 -W -Wall -ansi"),
"release" : Split("-O2 -ansi"),
@ -308,6 +308,7 @@ binary_nodes = map(eval, binaries)
if build == "release" : build_suffix = "" + env["PROGSUFFIX"]
else : build_suffix = "-" + build + env["PROGSUFFIX"]
map(lambda bin, node: Alias(bin, node, node and Copy("./" + bin + build_suffix, node[0].path)), binaries, binary_nodes)
binaries.remove("test")
env.Alias("all", map(Alias, binaries))
env.Default(map(Alias, env["default_targets"]))
all = env.Alias("all")

View file

@ -275,9 +275,8 @@ test_sources = Split("""
tests/main.cpp
tests/test_util.cpp
""")
test_env.Program("test", test_sources + [libwesnoth_core, libwesnoth],
CPPPATH = env["CPPPATH"] + ['/usr/include'],
LIBS = env["LIBS"] + ['boost_unit_test_framework'])
test = test_env.Program("test", test_sources + [libwesnoth_core, libwesnoth])
Export("test")
if env["svnrev"] != "" and env["svnrev"] != "exported":
revision_define = "#define REVISION \"%s\"\n" % env["svnrev"]
@ -287,7 +286,11 @@ if env["svnrev"] != "" and env["svnrev"] != "exported":
))
env.Append(CPPDEFINES = 'HAVE_REVISION')
sources = Flatten([glob(os.path.join(root, "*.cpp")) + glob(os.path.join(root, "*.hpp")) for (root, dir, files) in os.walk(".")])
sources = []
if "TAGS" in COMMAND_LINE_TARGETS:
EnsureSConsVersion(0, 98)
patterns = [ os.path.join(dir, file) for dir in ["", "*", "*/*"] for file in ["*.cpp", "*.hpp"] ]
sources = [ Glob(pattern, source=True, ondisk=False) for pattern in patterns ]
Export("sources")