SCons recipe no longer generates revision.hpp...

...and passes -DHAVE_REVISION if no revision information is available.
This commit is contained in:
Sergey Popov 2008-05-02 13:56:33 +00:00
parent f6e48f2853
commit 3536811e48
2 changed files with 9 additions and 6 deletions

View file

@ -460,7 +460,6 @@ env.Append(LINKFLAGS = "-Wl,--as-needed")
# Later in the recipe we will guarantee that src/revision.hpp exists
env.Replace(CPPDEFINES = [])
env.Append(CPPDEFINES = 'HAVE_REVISION')
if env["debug"]:
env.AppendUnique(CXXFLAGS = Split("-O0 -DDEBUG -ggdb3 -W -Wall -ansi"))

View file

@ -268,14 +268,18 @@ test_env.Program("../test", test_sources + [libwesnoth_core, libwesnoth],
CPPPATH = env["CPPPATH"] + ['/usr/include'],
LIBS = env["LIBS"] + ['boost_unit_test_framework'])
# FIXME: Currently this will only work under Linux
env["svnrev"] = commands.getoutput("LC_ALL=C svnversion -n . 2>/dev/null")
revision_define = ""
try:
env["svnrev"] = commands.getoutput("LC_ALL=C svnversion -n . 2>/dev/null")
except:
env["svnrev"] = ""
if env["svnrev"] != "" and env["svnrev"] != "exported":
revision_define = "#define REVISION \"%s\"\n" % env["svnrev"]
r = env.Command("revision.hpp", [],
r = env.Command("revision.hpp", [],
lambda target, source, env: open(str(target[0]), "w").write(revision_define))
env.AlwaysBuild(r)
env.Append(CPPDEFINES = 'HAVE_REVISION')
env.AlwaysBuild(r)
env.TargetSignatures('content')
#