aboutsummaryrefslogtreecommitdiffstats
path: root/waflib
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-09-15 08:41:21 +0200
committerDavid Robillard <d@drobilla.net>2018-09-15 08:53:35 +0200
commitefe1b5a266a65f84f1656e464b20e31cca3db467 (patch)
tree219c664e5f154ab3c5d0e19da46cd0da9886146e /waflib
parent7e02a0008d4299a19ea1d13a9c8e89c9fcebb74f (diff)
downloadpugl-efe1b5a266a65f84f1656e464b20e31cca3db467.tar.gz
pugl-efe1b5a266a65f84f1656e464b20e31cca3db467.tar.bz2
pugl-efe1b5a266a65f84f1656e464b20e31cca3db467.zip
Automatically define version
Diffstat (limited to 'waflib')
-rw-r--r--waflib/extras/autowaf.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/waflib/extras/autowaf.py b/waflib/extras/autowaf.py
index 57c0242..40d2373 100644
--- a/waflib/extras/autowaf.py
+++ b/waflib/extras/autowaf.py
@@ -11,7 +11,7 @@ import os
import subprocess
import sys
-from waflib import Build, Logs, Options, Utils
+from waflib import Build, Context, Logs, Options, Utils
from waflib.TaskGen import feature, before, after
global g_is_child
@@ -299,6 +299,11 @@ def configure(conf):
except:
pass # Test options do not exist
+ # Define version in configuration
+ appname = getattr(Context.g_module, Context.APPNAME, 'noname')
+ version = getattr(Context.g_module, Context.VERSION, '0.0.0')
+ define(conf, appname.upper() + '_VERSION', version)
+
conf.env.prepend_value('CFLAGS', '-I' + os.path.abspath('.'))
conf.env.prepend_value('CXXFLAGS', '-I' + os.path.abspath('.'))
g_step = 2