site_scons: support for clang/llvm
[senf.git] / site_scons / senfutil.py
index 8216902..da24b19 100644 (file)
@@ -225,7 +225,9 @@ def DefaultOptions(env):
 
     # Set nice default options
     env.Append(
-        CXXFLAGS         = [ '-Wall', '-Woverloaded-virtual',  "${profile and '-pg' or None}" ],
+        CXXFLAGS_CLANG   = [ '-Wno-unneeded-internal-declaration' ], # needed for BOOST_PARAMETER_KEYWORD
+        CXXFLAGS         = [ '-Wall', '-Woverloaded-virtual',  "${profile and '-pg' or None}",
+                             '${str(CXX).split("/")[-1] == "clang++" and "$CXXFLAGS_CLANG" or None}' ],
         CXXFLAGS_final   = [ '-O3', '-fno-threadsafe-statics', '-fno-stack-protector',
                                "${profile and ' ' or '-ffunction-sections'}" ],
         CXXFLAGS_normal  = [ '-O2', '-g' ],