summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-04-29 18:06:24 (GMT)
committerTobias Markmann <tm@ayena.de>2015-04-29 18:06:24 (GMT)
commit1e5ca0c1fe156cd614cfbfce432c40eeadb893fd (patch)
tree316ead0922410acd7866b802577ac9b24725f201 /BuildTools
parent68263f7cb360ae52915017df202775665c4eeeb6 (diff)
downloadswift-1e5ca0c1fe156cd614cfbfce432c40eeadb893fd.zip
swift-1e5ca0c1fe156cd614cfbfce432c40eeadb893fd.tar.bz2
Ignore compiler warnings from 3rdParty libraries
When compiling with Clang or GCC, include 3rdParty libraries as system headers and frameworks (-isystem and -f). Test-Information: Tested with Clang on OS X. Change-Id: I184221ddc4b34d30ee6ba66e202953619b5afd56
Diffstat (limited to 'BuildTools')
-rw-r--r--BuildTools/SCons/SConstruct6
-rw-r--r--BuildTools/SCons/Tools/qt4.py12
2 files changed, 14 insertions, 4 deletions
diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct
index d314ff3..6813747 100644
--- a/BuildTools/SCons/SConstruct
+++ b/BuildTools/SCons/SConstruct
@@ -294,13 +294,17 @@ if env.get("try_libxml", True) and not env.get("HAVE_LIBXML", 0) :
libxml_env = conf_env.Clone()
libxml_env.Append(CPPPATH = ["/usr/include/libxml2"])
conf = Configure(libxml_env, custom_tests = {"CheckVersion": CheckVersion})
if conf.CheckCHeader("libxml/parser.h") and conf.CheckLib("xml2") :
# and conf.CheckVersion("LibXML", "2.6.23", "LIBXML_VERSION", "libxml/xmlversion.h", 20623):
env["HAVE_LIBXML"] = 1
- env["LIBXML_FLAGS"] = { "CPPPATH": ["/usr/include/libxml2"], "LIBS": ["xml2"] }
+ libxml_env.Append()
+ if env["CC"] in ("clang", "gcc"):
+ env["LIBXML_FLAGS"] = { "CXXFLAGS": ["-isystem/usr/include/libxml2"], "LIBS": ["xml2"] }
+ else:
+ env["LIBXML_FLAGS"] = { "CPPPATH": ["/usr/include/libxml2"], "LIBS": ["xml2"] }
conf.Finish()
# Expat
if env.get("try_expat", True) and not env.get("HAVE_LIBXML",0) :
expat_conf_env = conf_env.Clone()
expat_flags = {}
diff --git a/BuildTools/SCons/Tools/qt4.py b/BuildTools/SCons/Tools/qt4.py
index ea86223..e019b2c 100644
--- a/BuildTools/SCons/Tools/qt4.py
+++ b/BuildTools/SCons/Tools/qt4.py
@@ -468,12 +468,18 @@ def enable_modules(self, modules, debug=False, crosscompiling=False, version='4'
}
for module in modules :
try : self.AppendUnique(CPPDEFINES=moduleDefines[module])
except: pass
debugSuffix = ''
+
+ include_flag = "-I"
+ if self["CC"] in ("gcc", "clang"):
+ include_flag = "-isystem"
+
+
if sys.platform != "win32" and sys.platform != "darwin" and not crosscompiling :
if self["qt"]:
# The user specified qt path in config.py and we are going to use the
# installation under that location.
UsePkgConfig = False
else:
@@ -541,28 +547,28 @@ def enable_modules(self, modules, debug=False, crosscompiling=False, version='4'
if sys.platform=="darwin" :
if debug : debugSuffix = 'd'
if len(self["QTDIR"]) > 0 :
self.AppendUnique(LIBPATH=[os.path.join('$QTDIR','lib')])
self.AppendUnique(LINKFLAGS="-F$QTDIR/lib")
- self.AppendUnique(CPPFLAGS="-F$QTDIR/lib")
+ self.AppendUnique(CPPFLAGS="-iframework$QTDIR/lib")
self.AppendUnique(LINKFLAGS="-L$QTDIR/lib") #TODO clean!
# FIXME: Phonon Hack
if version == '4' :
self.Append(LINKFLAGS=['-framework', "phonon"])
for module in modules :
if module in staticModules :
self.AppendUnique(LIBS=[module+debugSuffix]) # TODO: Add the debug suffix
self.AppendUnique(LIBPATH=[os.path.join("$QTDIR","lib")])
else :
if len(self["QTDIR"]) > 0 :
- self.Append(CPPFLAGS = ["-I" + os.path.join("$QTDIR", "lib", module + ".framework", "Versions", version, "Headers")])
+ self.Append(CPPFLAGS = [include_flag + os.path.join("$QTDIR", "lib", module + ".framework", "Versions", version, "Headers")])
else :
- self.Append(CPPFLAGS = ["-I" + os.path.join("/Library/Frameworks", module + ".framework", "Versions", version, "Headers")])
+ self.Append(CPPFLAGS = [include_flag + os.path.join("/Library/Frameworks", module + ".framework", "Versions", version, "Headers")])
self.Append(LINKFLAGS=['-framework', module])
if 'QtOpenGL' in modules:
self.AppendUnique(LINKFLAGS="-F/System/Library/Frameworks")
self.Append(LINKFLAGS=['-framework', 'AGL']) #TODO ughly kludge to avoid quotes
self.Append(LINKFLAGS=['-framework', 'OpenGL'])
self["QT4_MOCCPPPATH"] = self["CPPPATH"]