diff options
-rwxr-xr-x | BuildTools/GetBuildVersion.py | 4 | ||||
-rw-r--r-- | BuildTools/SCons/Tools/BuildVersion.py | 2 | ||||
-rw-r--r-- | BuildTools/SCons/Version.py | 4 | ||||
-rw-r--r-- | Sluift/SConscript | 2 | ||||
-rw-r--r-- | Swift/QtUI/SConscript | 2 |
5 files changed, 7 insertions, 7 deletions
diff --git a/BuildTools/GetBuildVersion.py b/BuildTools/GetBuildVersion.py index 9d7b29d..a362574 100755 --- a/BuildTools/GetBuildVersion.py +++ b/BuildTools/GetBuildVersion.py @@ -2,8 +2,8 @@ import sys sys.path.append("SCons") -import Version +import Version, os.path assert(len(sys.argv) == 2) -print Version.getBuildVersion(sys.argv[1]) +print Version.getBuildVersion(os.path.dirname(sys.argv[0] + "/.."), sys.argv[1]) diff --git a/BuildTools/SCons/Tools/BuildVersion.py b/BuildTools/SCons/Tools/BuildVersion.py index 8b195cd..41e6d8d 100644 --- a/BuildTools/SCons/Tools/BuildVersion.py +++ b/BuildTools/SCons/Tools/BuildVersion.py @@ -8,7 +8,7 @@ def generate(env) : static const char* buildVersion = \"%(buildVersion)s\";\n #define SWIFT_VERSION_STRING \"%(buildVersion)s\";\n -""" % { "buildVersion" : Version.getBuildVersion(project) } +""" % { "buildVersion" : Version.getBuildVersion(env.Dir("#").abspath, project) } env.WriteVal(target, env.Value(buildVersion)) env.AddMethod(createBuildVersion, "BuildVersion") diff --git a/BuildTools/SCons/Version.py b/BuildTools/SCons/Version.py index 4a2bf77..993536a 100644 --- a/BuildTools/SCons/Version.py +++ b/BuildTools/SCons/Version.py @@ -17,12 +17,12 @@ def git(cmd) : p.stdin.close() return gitVersion if p.wait() == 0 else None -def getBuildVersion(project) : +def getBuildVersion(root, project) : gitVersion = getGitBuildVersion(project) if gitVersion : return gitVersion else : - versionFilename = "VERSION." + project + versionFilename = os.path.join(root, "VERSION." + project) if os.path.isfile(versionFilename) : f = open(versionFilename) version = f.read().strip() diff --git a/Sluift/SConscript b/Sluift/SConscript index 6897f6d..7c434de 100644 --- a/Sluift/SConscript +++ b/Sluift/SConscript @@ -27,7 +27,7 @@ if env["SCONS_STAGE"] == "build" : else : myenv.Append(CFLAGS = ["-x", "c++"]) - myenv["SLUIFT_VERSION"] = Version.getBuildVersion("sluift") + myenv["SLUIFT_VERSION"] = Version.getBuildVersion(env.Dir("#").abspath, "sluift") def patchLua(env, target, source) : f = open(source[0].abspath, "r") contents = f.read() diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript index daaff63..58f2b99 100644 --- a/Swift/QtUI/SConscript +++ b/Swift/QtUI/SConscript @@ -134,7 +134,7 @@ sources = [ "qrc_Swift.cc", ] -myenv["SWIFT_VERSION"] = Version.getBuildVersion("swift") +myenv["SWIFT_VERSION"] = Version.getBuildVersion(env.Dir("#").abspath, "swift") if env["PLATFORM"] == "win32" : res = myenv.RES("../resources/Windows/Swift.rc") |