[Mesa-dev] [PATCH] scons: Fix build with clang.
Brian Paul
brianp at vmware.com
Wed Jul 25 06:55:12 PDT 2012
On 07/25/2012 12:06 AM, Vinson Lee wrote:
> Signed-off-by: Vinson Lee<vlee at freedesktop.org>
> ---
> scons/gallium.py | 3 ++-
> src/gallium/winsys/svga/drm/SConscript | 2 +-
> 2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/scons/gallium.py b/scons/gallium.py
> index 001a5de..458651b 100755
> --- a/scons/gallium.py
> +++ b/scons/gallium.py
> @@ -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
> diff --git a/src/gallium/winsys/svga/drm/SConscript b/src/gallium/winsys/svga/drm/SConscript
> index ee782c8..2d511d2 100644
> --- a/src/gallium/winsys/svga/drm/SConscript
> +++ b/src/gallium/winsys/svga/drm/SConscript
> @@ -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',
Looks OK to me.
Reviewed-by: Brian Paul <brianp at vmware.com>
More information about the mesa-dev
mailing list