summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-03-14 11:27:29 (GMT)
committerTobias Markmann <tm@ayena.de>2016-03-14 16:00:29 (GMT)
commit8cdebcff1d1e8321b070c7e675f9a9709a2b0b81 (patch)
tree2be3bc1fb4636f208e4a872c213b8e18fa1bb45f /BuildTools/SCons/SConscript.boot
parentfcb5204aeacd6c4bf49223f133df285f22f7cd4b (diff)
downloadswift-8cdebcff1d1e8321b070c7e675f9a9709a2b0b81.zip
swift-8cdebcff1d1e8321b070c7e675f9a9709a2b0b81.tar.bz2
Build all Swift projects as C++11
Added a SCons compiler test so that the build process fails early if C++11 is not supported. Remove C++11 checks as we now default to C++11 and they are not needed anymore. Ignore a Clang warning if building 3rdParty Boost. Test-Information: Tested build and unit tests on OS X 10.11.3. Change-Id: Icbecbd1e25e8d8bbe5f402f75355373a86b5f8a1
Diffstat (limited to 'BuildTools/SCons/SConscript.boot')
-rw-r--r--BuildTools/SCons/SConscript.boot15
1 files changed, 9 insertions, 6 deletions
diff --git a/BuildTools/SCons/SConscript.boot b/BuildTools/SCons/SConscript.boot
index 10b0daf..1811b28 100644
--- a/BuildTools/SCons/SConscript.boot
+++ b/BuildTools/SCons/SConscript.boot
@@ -174,11 +174,9 @@ if env["PLATFORM"] == "darwin" and env["target"] == "native" :
env["CCFLAGS"] = ["-arch", "x86_64"]
if "cxx" not in env :
env["CXX"] = "clang++"
- # Compiling Qt5 in C++0x mode includes headers that we don't have
- if not env["qt5"] :
- env["CXXFLAGS"] = ["-std=c++11"]
if "link" not in env :
- env["LINK"] = "clang"
+ # Use clang++ instead of clang, otherwise XCode's clang will cause linking errors due to missing C++ standard lib.
+ env["LINK"] = "clang++"
if platform.machine() == "x86_64" :
env.Append(LINKFLAGS = ["-arch", "x86_64"])
@@ -201,6 +199,8 @@ if "ar" in env :
if "link" in env :
env["SHLINK"] = env["link"]
env["LINK"] = env["link"]
+
+# Process user-defined external flags
for flags_type in ["ccflags", "cxxflags", "linkflags"] :
if flags_type in env :
if isinstance(env[flags_type], str) :
@@ -212,6 +212,10 @@ for flags_type in ["ccflags", "cxxflags", "linkflags"] :
# where you need it
env["OBJCCFLAGS"] = []
+# Compile code as C++11
+if env["PLATFORM"] != "win32" :
+ env.Append(CXXFLAGS = ["-std=c++11"])
+
if env["optimize"] :
if env["PLATFORM"] == "win32" :
env.Append(CCFLAGS = ["/O2"])
@@ -303,7 +307,7 @@ elif env["PLATFORM"] == "sunos" :
#env.Append(CXXFLAGS = ["-z verbose"])
pass
else :
- if "clang" in env["CXX"] :
+ if os.path.basename(env["CXX"]) in ["clang", "clang++"] :
env.Append(CXXFLAGS = [
"-Weverything",
"-Wno-unknown-warning-option", # To stay compatible between CLang versions
@@ -316,7 +320,6 @@ else :
"-Wno-c++98-compat-pedantic", # We do different things that violate this, but they could be fixed
"-Wno-global-constructors", # We depend on this for e.g. string constants
"-Wno-disabled-macro-expansion", # Caused due to system headers
- "-Wno-c++11-extensions", # We use C++11; turn this off when we use -std=c++11
"-Wno-long-long", # We use long long
"-Wno-padded",
"-Wno-missing-variable-declarations", # Getting rid of CPPUnit warnings