From dbf21467f0da3d4906c6854fa7dd13190463c3c3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 30 Jun 2015 15:56:26 +0200 Subject: build: always regenerate version hash Until now, it only used the hash from the previous configure run, instead of trying to get the latest hash. The "old" build system did this correctly - we just have to use the existing logic in version.sh. Since waf supports separate build dirs, extend version.sh with an argument for setting the path of version.h. --- wscript | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'wscript') diff --git a/wscript b/wscript index a5566d782f..68c06fb627 100644 --- a/wscript +++ b/wscript @@ -911,6 +911,12 @@ 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()) + def build(ctx): if ctx.options.variant not in ctx.all_envs: from waflib import Errors @@ -918,6 +924,7 @@ def build(ctx): 'The project was not configured: run "waf --variant={0} configure" first!' .format(ctx.options.variant)) ctx.unpack_dependencies_lists() + __write_version__(ctx) ctx.load('wscript_build') def init(ctx): -- cgit v1.2.3