summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-08-16 17:37:40 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-08-16 17:37:40 (GMT)
commit194ffe005d77ac1b83df050f99dea99af78f175c (patch)
tree4c334a2769cb87569ef027670e412c8bced137d1 /BuildTools
parent9b594b480fea33624fcf636adfa455aba5efb97f (diff)
downloadswift-contrib-194ffe005d77ac1b83df050f99dea99af78f175c.zip
swift-contrib-194ffe005d77ac1b83df050f99dea99af78f175c.tar.bz2
And some more tweaks.
Diffstat (limited to 'BuildTools')
-rw-r--r--BuildTools/SCons/SConstruct21
1 files changed, 16 insertions, 5 deletions
diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct
index 00587f3..6b5a9de 100644
--- a/BuildTools/SCons/SConstruct
+++ b/BuildTools/SCons/SConstruct
@@ -1,4 +1,4 @@
-import sys, os
+import sys, os, re
sys.path.append(Dir("BuildTools/SCons").abspath)
import SCons.SConf
@@ -15,8 +15,7 @@ vars.Add(BoolVariable("debug", "Compile with debug information", "yes" if os.nam
vars.Add(BoolVariable("warnings", "Compile with warnings turned on",
"yes" if os.name != "nt" else "no"))
vars.Add(BoolVariable("max_jobs", "Build with maximum number of parallel jobs", "no"))
-vars.Add(EnumVariable("target", "Choose a target platform for compilation", "native", ["native", "iphone-simulator", "iphone-device"]))
-vars.Add("iosversion", "Choose an iOS version to target")
+vars.Add(EnumVariable("target", "Choose a target platform for compilation", "native", ["native", "iphone-simulator", "iphone-device", "xcode"]))
if os.name != "nt" :
vars.Add(BoolVariable("coverage", "Compile with coverage information", "no"))
if os.name == "posix" :
@@ -149,13 +148,25 @@ if ARGUMENTS.get("SWIFT_INSTALLDIR", "") :
# cross-compiling
target = env["target"]
-iOSVersion = env.get("iosversion", "4.0")
+if target == "xcode" :
+ m = re.match(".*/iPhoneOS(.*)\.sdk", os.environ["SDKROOT"])
+ if m :
+ target = "iphone-device"
+ sdkVer = m.group(1)
+ else :
+ print "Matching simulator " + os.environ["SDKROOT"]
+ m = re.match(".*/iPhoneSimulator(.*)\.sdk", os.environ["SDKROOT"])
+ if m :
+ print "YAY"
+ target = "iphone-simulator"
+ sdkVer = m.group(1)
+else :
+ sdkVer = "4.0"
if target in ("iphone-device", "iphone-simulator"):
if target == "iphone-device":
sdkPart = "iPhoneOS"
else :
sdkPart = "iPhoneSimulator"
- sdkVer = iOSVersion
sdk = "/Developer/Platforms/" + sdkPart + ".platform/Developer/SDKs/" + sdkPart + sdkVer + ".sdk"
if target == "iphone-device":