aboutsummaryrefslogtreecommitdiffhomepage
path: root/wscript
diff options
context:
space:
mode:
authorGravatar Stefano Pigozzi <stefano.pigozzi@gmail.com>2015-07-11 19:03:44 +0200
committerGravatar Stefano Pigozzi <stefano.pigozzi@gmail.com>2015-07-12 10:09:49 +0200
commit78e771554cc37bc32a1ba631813aa5a41cc559f9 (patch)
tree594d3a52586d99320d696719f4080dcbd37ee5b0 /wscript
parent4a4f788a68a0ca73dcc3eed6ccd0533be4912b20 (diff)
build: fix version.h creation
Previous code did not retrigger a relink when version.h changed since it didn't use a waf task.
Diffstat (limited to 'wscript')
-rw-r--r--wscript14
1 files changed, 10 insertions, 4 deletions
diff --git a/wscript b/wscript
index 1cad348231..11a10a04b7 100644
--- a/wscript
+++ b/wscript
@@ -918,10 +918,16 @@ def configure(ctx):
ctx.store_dependencies_lists()
def __write_version__(ctx):
- import subprocess
- subprocess.call(["sh", "./version.sh",
- "--versionh=" + ctx.bldnode.abspath() + "/version.h"],
- cwd=ctx.srcnode.abspath())
+ ctx.env.VERSIONH_ST = '--versionh="%s"'
+ ctx.env.CWD_ST = '--cwd="%s"'
+ ctx.env.VERSIONSH_CWD = [ctx.srcnode.abspath()]
+
+ ctx(
+ source = 'version.sh',
+ target = 'version.h',
+ rule = 'sh ${SRC} ${CWD_ST:VERSIONSH_CWD} ${VERSIONH_ST:TGT}',
+ always = True,
+ update_outputs = True)
def build(ctx):
if ctx.options.variant not in ctx.all_envs: