ocarina/include/Sconscript
Anna Schumaker 77fc2fff5c version: Add a "+" to version string
I use this to show that there have been any changes since the last
release.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-26 08:43:14 -05:00

20 lines
416 B
Python

#!/usr/bin/python
import subprocess
Import("env", "test_env")
version = str(env.Version)
if env.Debug == True:
version += "-debug"
try:
devnull = open("/dev/null", "w")
diff = subprocess.check_output("git diff $(git describe --abbrev=0)",
stderr=devnull, shell=True)
if diff != "":
version += "+"
except:
pass
for e in (env, test_env):
e.Append( CCFLAGS = [ "-DCONFIG_VERSION='\"%s\"'" % version ] )