From ac6ff12e174b832326c6d89784d4c5e53044eecf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Fri, 16 Aug 2013 20:39:52 +0200 Subject: Make missing SConstruct dependencies non-fatal for Ninja build. Change-Id: Id11311c9fca7b7baa3d02e3ebce62deadc5a7de5 diff --git a/.gitignore b/.gitignore index b37b74b..f3e0c2f 100644 --- a/.gitignore +++ b/.gitignore @@ -41,6 +41,7 @@ config.py config.log .sconf_temp .sconsign.dblite +.scons2ninja.deps Swiften/Examples/TuneBot/TuneBot Swift/QtUI/swift-im Swift/QtUI/swift diff --git a/.scons2ninja.conf b/.scons2ninja.conf index 883cccd..f6c470e 100644 --- a/.scons2ninja.conf +++ b/.scons2ninja.conf @@ -1,7 +1,7 @@ import glob scons_cmd = "python 3rdParty/SCons/scons.py" -scons_dependencies += glob.glob("BuildTools/SCons/**/*.py") + glob.glob("BuildTools/SCons/SCons*") +scons_dependencies += glob.glob("BuildTools/SCons/**/*.py") + glob.glob("BuildTools/SCons/SCons*") + ["config.py"] def ninja_post(ninja) : # Unit tests diff --git a/BuildTools/scons2ninja.py b/BuildTools/scons2ninja.py index 1af52d7..98b3518 100755 --- a/BuildTools/scons2ninja.py +++ b/BuildTools/scons2ninja.py @@ -322,6 +322,7 @@ ninja.rule('ibtool', ninja.rule('generator', command = "python " + SCRIPT + " ${scons_args}", + depfile = ".scons2ninja.deps", pool = 'scons_pool', generator = '1', description = 'Regenerating build.ninja') @@ -566,7 +567,7 @@ for line in build_lines : ninja.build('_generated_headers', 'phony', ninja.header_targets()) # Regenerate build.ninja file -ninja.build('build.ninja', 'generator', [], deps = [SCRIPT, CONFIGURATION_FILE] + scons_dependencies) +ninja.build('build.ninja', 'generator', [], deps = [SCRIPT, CONFIGURATION_FILE]) # Header & variables ninja.header("# This file is generated by " + SCRIPT) @@ -584,6 +585,10 @@ if 'ninja_post' in dir() : # Result ################################################################################ +f = open(".scons2ninja.deps", "w") +f.write("build.ninja: " + " ".join([d for d in scons_dependencies if os.path.exists(d)]) + "\n") +f.close() + f = open("build.ninja", "w") f.write(ninja.serialize()) f.close() -- cgit v0.10.2-6-g49f6