summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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()