SCons: make OSL linking work on windows, and fix OSL compiler path issue to
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 19 Nov 2012 14:54:35 +0000 (14:54 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 19 Nov 2012 14:54:35 +0000 (14:54 +0000)
properly expand to absolute path.

build_files/scons/config/win32-vc-config.py
build_files/scons/config/win64-vc-config.py
intern/cycles/kernel/shaders/SConscript

index 39031ef27ca7f525f93a1c2227f61a709d8e8d5c..93174c4330d7b3dd74ec6635ee972eaa76907462 100644 (file)
@@ -150,28 +150,34 @@ WITH_BF_OPENMP = True
 #Cycles
 WITH_BF_CYCLES = True 
 
-#OSL
 WITH_BF_CYCLES_OSL = False
 WITH_BF_STATICOSL = True
-BF_OSL = LIBDIR + '/osl'
+BF_OSL = '${LIBDIR}/osl'
 BF_OSL_INC = '${BF_OSL}/include'
-# note oslexec would passed via program linkflags, which is needed to
-# make llvm happy with osl_allocate_closure_component
-BF_OSL_LIB = 'oslcomp oslexec oslquery'
 BF_OSL_LIBPATH = '${BF_OSL}/lib'
+BF_OSL_LIB_STATIC = '${BF_OSL_LIBPATH}/oslcomp.lib ${BF_OSL_LIBPATH}/oslexec.lib ${BF_OSL_LIBPATH}/oslquery.lib '
 BF_OSL_COMPILER = '${BF_OSL}/bin/oslc'
 
+WITH_BF_LLVM = True
+BF_LLVM = LIBDIR + '/llvm'
+BF_LLVM_LIB = 'LLVMBitReader LLVMJIT LLVMipo LLVMVectorize LLVMBitWriter LLVMX86CodeGen LLVMX86Desc LLVMX86Info LLVMX86AsmPrinter ' + \
+    'LLVMX86Utils LLVMSelectionDAG LLVMCodeGen LLVMScalarOpts LLVMInstCombine LLVMTransformUtils LLVMipa LLVMAnalysis LLVMExecutionEngine ' + \
+    'LLVMTarget LLVMMC LLVMCore LLVMSupport'
+BF_LLVM_LIBPATH = '${BF_LLVM}/lib'
+
 WITH_BF_OIIO = True
 BF_OIIO = '${LIBDIR}/openimageio'
 BF_OIIO_INC = '${BF_OIIO}/include'
-BF_OIIO_LIB = 'OpenImageIO'
 BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
+BF_OIIO_LIB_STATIC = '${BF_OIIO_LIBPATH}/OpenImageIO.lib'
+WITH_BF_STATICOIIO = True
 
 WITH_BF_OCIO = True
 BF_OCIO = '${LIBDIR}/opencolorio'
 BF_OCIO_INC = '${BF_OCIO}/include'
-BF_OCIO_LIB = 'OpenColorIO'
 BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
+BF_OCIO_LIB_STATIC = '${BF_OCIO_LIBPATH}/OpenColorIO.lib'
+WITH_BF_STATICOCIO = True
 
 WITH_BF_BOOST = True
 BF_BOOST = '${LIBDIR}/boost'
index 2434cb0c63aa12f239ce5a85e6e0466271a97f56..2d1c59c5db92d400fb15a0ae8ff71457f882dd04 100644 (file)
@@ -146,28 +146,34 @@ WITH_BF_OPENMP = True
 #Cycles
 WITH_BF_CYCLES = True
 
-#OSL
 WITH_BF_CYCLES_OSL = False
 WITH_BF_STATICOSL = True
-BF_OSL = LIBDIR + '/osl'
+BF_OSL = '${LIBDIR}/osl'
 BF_OSL_INC = '${BF_OSL}/include'
-# note oslexec would passed via program linkflags, which is needed to
-# make llvm happy with osl_allocate_closure_component
-BF_OSL_LIB = 'oslcomp oslexec oslquery'
 BF_OSL_LIBPATH = '${BF_OSL}/lib'
+BF_OSL_LIB_STATIC = '${BF_OSL_LIBPATH}/oslcomp.lib ${BF_OSL_LIBPATH}/oslexec.lib ${BF_OSL_LIBPATH}/oslquery.lib '
 BF_OSL_COMPILER = '${BF_OSL}/bin/oslc'
 
+WITH_BF_LLVM = True
+BF_LLVM = LIBDIR + '/llvm'
+BF_LLVM_LIB = 'LLVMBitReader LLVMJIT LLVMipo LLVMVectorize LLVMBitWriter LLVMX86CodeGen LLVMX86Desc LLVMX86Info LLVMX86AsmPrinter ' + \
+    'LLVMX86Utils LLVMSelectionDAG LLVMCodeGen LLVMScalarOpts LLVMInstCombine LLVMTransformUtils LLVMipa LLVMAnalysis LLVMExecutionEngine ' + \
+    'LLVMTarget LLVMMC LLVMCore LLVMSupport'
+BF_LLVM_LIBPATH = '${BF_LLVM}/lib'
+
 WITH_BF_OIIO = True
 BF_OIIO = '${LIBDIR}/openimageio'
 BF_OIIO_INC = '${BF_OIIO}/include'
-BF_OIIO_LIB = 'OpenImageIO'
 BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
+BF_OIIO_LIB_STATIC = '${BF_OIIO_LIBPATH}/OpenImageIO.lib'
+WITH_BF_STATICOIIO = True
 
 WITH_BF_OCIO = True
 BF_OCIO = '${LIBDIR}/opencolorio'
 BF_OCIO_INC = '${BF_OCIO}/include'
-BF_OCIO_LIB = 'OpenColorIO'
 BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
+BF_OCIO_LIB_STATIC = '${BF_OCIO_LIBPATH}/OpenColorIO.lib'
+WITH_BF_STATICOCIO = True
 
 WITH_BF_BOOST = True
 BF_BOOST = '${LIBDIR}/boost'
index 513bef9605af67d073d4e5f6b54cf1490701be4b..f1c30395b70a9d4c20a252bff1071431711283d3 100644 (file)
@@ -13,11 +13,8 @@ oso_files = []
 if env['WITH_BF_CYCLES_OSL']:
     shaders = env.Clone()
 
-    # osl compiler info
-    if env['OURPLATFORM']=='darwin':
-        osl_compiler = env['LCGDIR'][1:] + '/osl/bin/oslc' # get the leading "#" away that breaks shadercompile
-    else:
-        osl_compiler = env['BF_OSL_COMPILER']
+    # osl compiler
+    osl_compiler = env._canonicalize(env.subst(env['BF_OSL_COMPILER']))
 
     # build directory
     root_build_dir = normpath(env['BF_BUILDDIR'])