summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '.scons2ninja.conf')
-rw-r--r--.scons2ninja.conf25
1 files changed, 24 insertions, 1 deletions
diff --git a/.scons2ninja.conf b/.scons2ninja.conf
index 9ea1c57..0ad2ef4 100644
--- a/.scons2ninja.conf
+++ b/.scons2ninja.conf
@@ -1,4 +1,4 @@
-import glob
+import glob, re, os.path
scons_cmd = "python 3rdParty/SCons/scons.py"
scons_dependencies += glob.glob("BuildTools/SCons/**/*.py") + glob.glob("BuildTools/SCons/SCons*") + ["config.py"]
@@ -20,3 +20,26 @@ def ninja_post(ninja) :
ninja.build(['Sluift', 'sluift'], 'phony', ['Sluift\\exe\\sluift.exe', 'Sluift\\dll\\sluift.dll'])
elif sys.platform in ['posix', 'darwin'] :
ninja.build(['Sluift', 'sluift'], 'phony', ['Sluift/exe/sluift', 'Sluift/dll/sluift.so'])
+
+ # Extra rules
+ if sys.platform == "darwin" :
+ ninja.rule('zip',
+ command = 'cd $dir && zip -r $relative_out $relative_in',
+ description = 'ZIP $out')
+
+ ninja.rule('package',
+ command = 'Swift/Packaging/MacOSX/package.sh $in $template $out $qtdir',
+ description = 'PACKAGE $out')
+
+
+def ninja_custom_command(ninja, command) :
+ if sys.platform == "darwin" :
+ m = re.match("cd (.*) && zip -r (.*) (.*)", line)
+ if m :
+ ninja.build(os.path.relpath(m.group(2)), 'zip', os.path.join(m.group(1), m.group(3)), dir = m.group(1), relative_in = m.group(3), relative_out = os.path.relpath(m.group(2), m.group(1)))
+ return True
+ m = re.match(".*/MacOSX/package.sh (.*) (.*) (.*) (.*)", line)
+ if m :
+ ninja.build(m.group(3), 'package', m.group(1), deps = [m.group(2)], qtdir = m.group(4), template = m.group(2))
+ return True
+ return False