summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2013-08-16 18:39:52 (GMT)
committerRemko Tronçon <git@el-tramo.be>2013-08-16 19:02:28 (GMT)
commitac6ff12e174b832326c6d89784d4c5e53044eecf (patch)
treebaa8696c51b28c441f296e79e403079edde99145
parentfe32a6d90bd0b4f931bdfce91d3a982b5fbc599d (diff)
downloadswift-ac6ff12e174b832326c6d89784d4c5e53044eecf.zip
swift-ac6ff12e174b832326c6d89784d4c5e53044eecf.tar.bz2
Make missing SConstruct dependencies non-fatal for Ninja build.
Change-Id: Id11311c9fca7b7baa3d02e3ebce62deadc5a7de5
-rw-r--r--.gitignore1
-rw-r--r--.scons2ninja.conf2
-rwxr-xr-xBuildTools/scons2ninja.py7
3 files changed, 8 insertions, 2 deletions
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()