From efe1b5a266a65f84f1656e464b20e31cca3db467 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 15 Sep 2018 08:41:21 +0200 Subject: Automatically define version --- waflib/extras/autowaf.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'waflib') 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 -- cgit v1.2.1