further OSX build fixes

metadata
Wenzel Jakob 2011-08-19 14:49:52 -04:00
parent a3896c0f89
commit f2be676458
2 changed files with 12 additions and 24 deletions

View File

@ -274,28 +274,18 @@ def remove_flag(env, flag):
except: except:
return False return False
def remove_flags(env, patterns): def match_pattern(x, patterns):
new_cxxflags = [] match = False
new_linkflags = []
for flag in env['CXXFLAGS']:
found = False
for pattern in patterns: for pattern in patterns:
if re.search(pattern, flag): if re.search(pattern, x):
found = True match = True
break break
if not found: return match
new_cxxflags.append(flag)
for flag in env['LINKFLAGS']:
found = False
for pattern in patterns:
if re.search(pattern, flag):
found = True
break
if not found:
new_cxxflags.append(flag)
env['CXXFLAGS'] = new_cxxflags
env['LINKFLAGS'] = new_linkflags
def remove_flags(env, patterns):
env['CCFLAGS'][:] = [ x for x in env['CCFLAGS'] if not match_pattern(x, patterns) ]
env['CXXFLAGS'][:] = [ x for x in env['CXXFLAGS'] if not match_pattern(x, patterns) ]
env['LINKFLAGS'][:] = [ x for x in env['LINKFLAGS'] if not match_pattern(x, patterns) ]
def append_flag(env, value): def append_flag(env, value):
env['CXXFLAGS'].append(value) env['CXXFLAGS'].append(value)
@ -313,8 +303,7 @@ def configure_for_objective_cpp(env):
# Remove Intel compiler-specific optimization flags # Remove Intel compiler-specific optimization flags
env.RemoveFlags(['-x.*', '-ax.*', '-ipo', '-no-prec-div', env.RemoveFlags(['-x.*', '-ax.*', '-ipo', '-no-prec-div',
'-fp-model', 'fast=.*', '-wd.*', '-openmp']) '-fp-model', 'fast=.*', '-wd.*', '-openmp'])
env.AppendFlag('-fno-strict-aliasing') env['CCFLAGS'] += ['-fno-strict-aliasing']
env.AppendFlag('-fopenmp')
# Enforce GCC usage (Intel compiler doesn't handle Objective C/C++) # Enforce GCC usage (Intel compiler doesn't handle Objective C/C++)
env['CXX'] = 'g++' env['CXX'] = 'g++'
env['CC'] = 'gcc' env['CC'] = 'gcc'

View File

@ -29,7 +29,6 @@ plugins += env.SharedLibrary('sssbrdf', ['sssbrdf.cpp'])
# pretty heavy stuff to compile. Go easy on the compiler flags: # pretty heavy stuff to compile. Go easy on the compiler flags:
irawanEnv = env.Clone() irawanEnv = env.Clone()
irawanEnv.RelaxCompilerSettings() irawanEnv.RelaxCompilerSettings()
plugins += irawanEnv.SharedLibrary('irawan', ['irawan.cpp']) plugins += irawanEnv.SharedLibrary('irawan', ['irawan.cpp'])
Export('plugins') Export('plugins')