swr: add linux to scons build
authorGeorge Kyriazis <george.kyriazis@intel.com>
Thu, 13 Apr 2017 13:44:08 +0000 (08:44 -0500)
committerGeorge Kyriazis <george.kyriazis@intel.com>
Fri, 14 Apr 2017 15:59:46 +0000 (10:59 -0500)
Make swr compile for both linux and windows.

Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
src/gallium/drivers/swr/SConscript
src/gallium/targets/libgl-xlib/SConscript

index eca5dba8304dd8ebaf588ccdbcdee3b4fc605ba0..5e3784b51f472002c46c6482b4b3310306a121e9 100644 (file)
@@ -17,11 +17,6 @@ if env['LLVM_VERSION'] < distutils.version.LooseVersion('3.9'):
     env['swr'] = False
     Return()
 
-if env['platform'] != 'windows':
-    print "warning: swr scons build only supports windows: not building swr"
-    env['swr'] = False
-    Return()
-
 env.MSVC2013Compat()
 
 env = env.Clone()
@@ -205,7 +200,7 @@ envavx2.Append(CPPDEFINES = ['KNOB_ARCH=KNOB_ARCH_AVX2'])
 if env['platform'] == 'windows':
     envavx2.Append(CCFLAGS = ['/arch:AVX2'])
 else:
-    envavx2.Append(CCFLAGS = ['-mavx2'])
+    envavx2.Append(CCFLAGS = ['-mavx2', '-mfma', '-mbmi2', '-mf16c'])
 
 swrAVX2 = envavx2.SharedLibrary(
     target = 'swrAVX2',
index d01bb3c2563b5e684885c51dfe854622ed48e02d..a81ac79325156f5011b43c1547a103d042eb551d 100644 (file)
@@ -49,7 +49,7 @@ if env['llvm']:
     env.Prepend(LIBS = [llvmpipe])
 
     if env['swr']:
-        env.Append(CPPDEFINES = 'HAVE_SWR')
+        env.Append(CPPDEFINES = 'GALLIUM_SWR')
         env.Prepend(LIBS = [swr])
 
 if env['platform'] != 'darwin':