metadata
Wenzel Jakob 2011-08-16 14:38:48 -04:00
commit f2c3f5ad63
3 changed files with 58 additions and 4 deletions

View File

@ -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]] )

View File

@ -0,0 +1,32 @@
BUILDDIR = '#build/release'
DISTDIR = '#Mitsuba.app'
CXX = 'icpc'
CC = 'icc'
CXXFLAGS = ['-arch', 'x86_64', '-mmacosx-version-min=10.6', '-mfpmath=sse', '-isysroot', '/Developer/SDKs/MacOSX10.6.sdk', '-O3', '-ipo', '-xSSSE3', '-fp-model', 'fast=2', '-openmp', '-wd279', '-Wall', '-g', '-pipe', '-DMTS_DEBUG', '-DSINGLE_PRECISION', '-DSPECTRUM_SAMPLES=3', '-DMTS_SSE', '-DMTS_HAS_COHERENT_RT']
LINKFLAGS = ['-framework', 'OpenGL', '-framework', 'Cocoa', '-arch', 'x86_64', '-mmacosx-version-min=10.6', '-Wl,-syslibroot,/Developer/SDKs/MacOSX10.6.sdk', '-openmp']
BASEINCLUDE = ['#include']
BASELIB = ['m', 'pthread', 'gomp']
OEXRINCLUDE = ['#dependencies/darwin/OpenEXR.framework/Headers/OpenEXR']
OEXRLIBDIR = ['#dependencies/darwin/OpenEXR.framework/Resources/lib']
OEXRLIB = ['Half', 'IlmImf', 'Imath', 'z']
PNGINCLUDE = ['#dependencies/darwin/libpng.framework/Headers']
PNGLIBDIR = ['#dependencies/darwin/libpng.framework/Resources/lib']
PNGLIB = ['png']
JPEGINCLUDE = ['#dependencies/darwin/libjpeg.framework/Headers']
JPEGLIBDIR = ['#dependencies/darwin/libjpeg.framework/Resources/lib']
JPEGLIB = ['jpeg']
XERCESINCLUDE = ['#dependencies/darwin/Xerces-C.framework/Headers']
XERCESLIBDIR = ['#dependencies/darwin/Xerces-C.framework/Resources/lib']
XERCESLIB = ['xerces-c']
GLINCLUDE = ['#dependencies/darwin/GLEW.framework/Headers']
GLLIBDIR = ['#dependencies/darwin/GLEW.framework/Resources/libs']
GLLIB = ['GLEW', 'objc']
GLFLAGS = ['-DGLEW_MX']
BOOSTINCLUDE = ['#dependencies']
BOOSTLIB = ['boost_filesystem', 'boost_system']
BOOSTLIBDIR = ['#dependencies/darwin/libboost.framework/Resources/lib']
PYTHONINCLUDE = ['/System/Library/Frameworks/Python.framework/Versions/2.6/Headers']
PYTHONLIB = ['boost_python', 'boost_system', 'Python']
COLLADAINCLUDE = ['#dependencies/windows/include/colladadom', '#dependencies/windows/include/colladadom/1.4']
COLLADALIB = ['libCollada14Dom']
COLLADALIBDIR = ['#dependencies/darwin/Collada14Dom.framework/Resources/lib']

View File

@ -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')