20 lines
416 B
Python
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 ] )
|