summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2012-12-09 16:20:55 (GMT)
committerRemko Tronçon <git@el-tramo.be>2012-12-22 14:25:36 (GMT)
commit2b7f55a30b07f08d32bccd3ea0a72ffd8c820c20 (patch)
tree2b2e9455132a61763084aad4cf026c6cd5946867 /Documentation/SwiftenDevelopersGuide/Examples/EchoBot
parent97be7ed34538186e34575cc9a0426aaf9260f64e (diff)
downloadswift-2b7f55a30b07f08d32bccd3ea0a72ffd8c820c20.zip
swift-2b7f55a30b07f08d32bccd3ea0a72ffd8c820c20.tar.bz2
Use precompiled header in EchoBot variants.
This slightly speeds up compilation on Windows. Adding this mostly as demonstrating/documentation purposes. Change-Id: Ic50aaef04589c79b926a0dcb4bb8d00284fd5a21
Diffstat (limited to 'Documentation/SwiftenDevelopersGuide/Examples/EchoBot')
-rw-r--r--Documentation/SwiftenDevelopersGuide/Examples/EchoBot/.gitignore1
-rw-r--r--Documentation/SwiftenDevelopersGuide/Examples/EchoBot/SConscript12
2 files changed, 13 insertions, 0 deletions
diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/.gitignore b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/.gitignore
index 91c939b..aca6fe1 100644
--- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/.gitignore
+++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/.gitignore
@@ -2,3 +2,4 @@ EchoBot?
*.cpp.xml
*.h.xml
EchoComponent
+Swiften.cpp
diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/SConscript b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/SConscript
index b267e80..84cc80b 100644
--- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/SConscript
+++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/SConscript
@@ -4,6 +4,18 @@ example_env = env.Clone()
example_env.UseFlags(example_env["SWIFTEN_FLAGS"])
example_env.UseFlags(example_env["SWIFTEN_DEP_FLAGS"])
+# Precompile Swiften header
+# This is useful to slightly speed up compilation.
+if example_env["PLATFORM"] == "win32":
+ # Precompiled headers don't work with /Z7. We don't really need /Z7 here, so using
+ # the more standard /Zi.
+ if example_env["debug"] :
+ example_env.Replace(CCFLAGS = [flag for flag in env["CCFLAGS"] if flag != "/Z7"])
+ example_env.Append(CCFLAGS = "/Zi")
+ example_env.WriteVal("Swiften.cpp", example_env.Value("#include <Swiften/Swiften.h>\n"))
+ example_env["PCH"] = example_env.PCH("Swiften.cpp")[0]
+ example_env["PCHSTOP"] = "Swiften/Swiften.h"
+
for i in range(1,7) :
example_env.Program("EchoBot" + str(i), ["EchoBot" + str(i) + ".cpp"])
example_env.Program("EchoComponent", "EchoComponent.cpp")