OSX build improvements
parent
22fc12ba8a
commit
babb13d144
|
@ -270,8 +270,9 @@ def osxlibinst_as_build_function(self, target, source, pkgname = None, use_own =
|
|||
def remove_flag(env, value):
|
||||
try:
|
||||
env['CXXFLAGS'].remove(value)
|
||||
return True
|
||||
except:
|
||||
pass
|
||||
return False
|
||||
|
||||
def append_flag(env, value):
|
||||
env['CXXFLAGS'].append(value)
|
||||
|
@ -281,14 +282,29 @@ env.__class__.AppendFlag = append_flag
|
|||
env.__class__.OSXLibInst = osxlibinst_build_function
|
||||
env.__class__.OSXLibInstAs = osxlibinst_as_build_function
|
||||
|
||||
def prepare_for_objective_cpp(env):
|
||||
def configure_for_objective_cpp(env):
|
||||
# Objective C++ does not permit the following optimization flags
|
||||
env.RemoveFlag('-fstrict-aliasing')
|
||||
env.RemoveFlag('-ftree-vectorize')
|
||||
env.RemoveFlag('-std=c++0x')
|
||||
env.AppendFlag('-fno-strict-aliasing')
|
||||
|
||||
env.__class__.ConfigureForObjectiveCPP = prepare_for_objective_cpp
|
||||
def relax_compiler_settings(env):
|
||||
# Relax the compiler settings when compiling heavy templated code
|
||||
# (e.g. Boost::Spirit parsers, etc., which don't necessarily have
|
||||
# to be that fast)
|
||||
env.RemoveFlag('-g')
|
||||
env.RemoveFlag('/Z7')
|
||||
env.RemoveFlag('-ipo')
|
||||
env.RemoveFlag('/Qipo')
|
||||
env.RemoveFlag('/GL')
|
||||
if env.RemoveFlag('-O3'):
|
||||
env.AppendFlag('-O1')
|
||||
if env.RemoveFlag('/O2'):
|
||||
env.AppendFlag('/O1')
|
||||
|
||||
env.__class__.ConfigureForObjectiveCPP = configure_for_objective_cpp
|
||||
env.__class__.RelaxCompilerSettings = relax_compiler_settings
|
||||
|
||||
if hasCollada:
|
||||
env.Append(CPPDEFINES = [['MTS_HAS_COLLADA', 1]] )
|
||||
|
|
|
@ -20,10 +20,16 @@ plugins += env.SharedLibrary('bump', ['bump.cpp'])
|
|||
# Other materials
|
||||
plugins += env.SharedLibrary('ward', ['ward.cpp'])
|
||||
plugins += env.SharedLibrary('phong', ['phong.cpp'])
|
||||
plugins += env.SharedLibrary('irawan', ['irawan.cpp'])
|
||||
plugins += env.SharedLibrary('difftrans', ['difftrans.cpp'])
|
||||
plugins += env.SharedLibrary('hk', ['hk.cpp'])
|
||||
plugins += env.SharedLibrary('dipolebrdf', ['dipolebrdf.cpp'])
|
||||
plugins += env.SharedLibrary('sssbrdf', ['sssbrdf.cpp'])
|
||||
|
||||
# The Irawan-Marschner plugin uses a Boost::Spirit parser, which makes it
|
||||
# pretty heavy stuff to compile. Go easy on the compiler flags:
|
||||
irawanEnv = env.Clone()
|
||||
irawanEnv.RelaxCompilerSettings()
|
||||
|
||||
plugins += irawanEnv.SharedLibrary('irawan', ['irawan.cpp'])
|
||||
|
||||
Export('plugins')
|
||||
|
|
Loading…
Reference in New Issue