scons: Fix build with clang.
authorVinson Lee <vlee@freedesktop.org>
Wed, 25 Jul 2012 06:02:18 +0000 (23:02 -0700)
committerVinson Lee <vlee@freedesktop.org>
Thu, 26 Jul 2012 00:04:30 +0000 (17:04 -0700)
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
scons/gallium.py
src/gallium/winsys/svga/drm/SConscript

index 001a5def1a795f541e4c71f351495071e5033d24..458651b4513ebe85b737e80911f123153caf3704 100755 (executable)
@@ -140,6 +140,7 @@ def generate(env):
     env['gcc'] = 'gcc' in os.path.basename(env['CC']).split('-')
     env['msvc'] = env['CC'] == 'cl'
     env['suncc'] = env['platform'] == 'sunos' and os.path.basename(env['CC']) == 'cc'
+    env['clang'] = env['CC'] == 'clang'
 
     if env['msvc'] and env['toolchain'] == 'default' and env['machine'] == 'x86_64':
         # MSVC x64 support is broken in earlier versions of scons
@@ -482,7 +483,7 @@ def generate(env):
     env.Append(SHLINKFLAGS = shlinkflags)
 
     # We have C++ in several libraries, so always link with the C++ compiler
-    if env['gcc']:
+    if env['gcc'] or env['clang']:
         env['LINK'] = env['CXX']
 
     # Default libs
index ee782c8b0310aa63a649e272e92b964ed2266877..2d511d2bb5e73c983c678d4e2f2c75a09225fc6c 100644 (file)
@@ -4,7 +4,7 @@ env = env.Clone()
 
 env.PkgUseModules('DRM')
 
-if env['gcc']:
+if env['gcc'] or env['clang']:
     env.Append(CCFLAGS = ['-fvisibility=hidden'])
     env.Append(CPPDEFINES = [
         'HAVE_STDINT_H',