OSX/scons: make gcc version detection more futureproof

This commit is contained in:
Jens Verwiebe
2013-11-07 15:05:59 +00:00
parent 67162306a7
commit e572a433a8
2 changed files with 5 additions and 2 deletions

View File

@@ -409,10 +409,12 @@ if env['OURPLATFORM']=='darwin':
#Defaults openMP to true if compiler handles it ( only gcc 4.6.1 and newer )
# if your compiler does not have accurate suffix you may have to enable it by hand !
if env['WITH_BF_OPENMP'] == 1:
if env['CC'][:-2].endswith('4.6') or env['CC'][:-2].endswith('4.8'):
if env['CC'].split('/')[len(env['CC'].split('/'))-1][4:] >= '4.6.1':
env['WITH_BF_OPENMP'] = 1 # multithreading for fluids, cloth, sculpt and smoke
print B.bc.OKGREEN + "Using OpenMP"
else:
env['WITH_BF_OPENMP'] = 0
print B.bc.OKGREEN + "Disabled OpenMP"
if env['WITH_BF_CYCLES_OSL'] == 1:
OSX_OSL_LIBPATH = Dir(env.subst(env['BF_OSL_LIBPATH'])).abspath

View File

@@ -700,7 +700,8 @@ def AppIt(target=None, source=None, env=None):
commands.getoutput(cmd)
cmd = 'find %s/%s.app -name __MACOSX -exec rm -rf {} \;'%(installdir, binary)
commands.getoutput(cmd)
if env['CC'][:-2].endswith('4.6') or env['CC'][:-2].endswith('4.8'): # for correct errorhandling with gcc 4.6/4.8.x we need the gcc.dylib and gomp.dylib to link, thus distribute in app-bundle
if env['CC'].split('/')[len(env['CC'].split('/'))-1][4:] >= '4.6.1': # for correct errorhandling with gcc <= 4.6.1 we need the gcc.dylib and gomp.dylib to link, thus distribute in app-bundle
print "Bundling libgcc and libgomp"
cmd = 'mkdir %s/%s.app/Contents/MacOS/lib'%(installdir, binary)
commands.getoutput(cmd)
instname = env['BF_CXX']