Cycles OSL: windows build system changes to support static OSL/OIIO.

This commit is contained in:
Brecht Van Lommel 2012-11-15 17:16:27 +00:00
parent 1c9b548d92
commit 2324c80f50
7 changed files with 26 additions and 26 deletions

@ -403,7 +403,7 @@ if(WITH_CYCLES OR WITH_MOD_BOOLEAN OR WITH_AUDASPACE OR WITH_INTERNATIONAL)
endif() endif()
# auto enable llvm for cycles_osl # auto enable llvm for cycles_osl
if(WITH_CYCLES_OSL AND NOT WIN32) if(WITH_CYCLES_OSL)
set(WITH_LLVM ON CACHE BOOL "ON" FORCE) set(WITH_LLVM ON CACHE BOOL "ON" FORCE)
endif() endif()
@ -942,6 +942,13 @@ elseif(WIN32)
endif() endif()
endif() endif()
if(WITH_LLVM)
set(LLVM_DIRECTORY ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation")
file(GLOB LLVM_LIBRARY ${LLVM_DIRECTORY}/lib/*.lib)
set(LLVM_STATIC YES)
endif()
if(MSVC) if(MSVC)
set(PLATFORM_LINKLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid) set(PLATFORM_LINKLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid)
@ -1675,7 +1682,7 @@ if(WITH_CYCLES)
message(FATAL_ERROR "Cycles reqires WITH_BOOST, the library may not have been found. Configure BOOST or disable WITH_CYCLES") message(FATAL_ERROR "Cycles reqires WITH_BOOST, the library may not have been found. Configure BOOST or disable WITH_CYCLES")
endif() endif()
if(WITH_CYCLES_OSL AND NOT WIN32) if(WITH_CYCLES_OSL)
if(NOT WITH_LLVM) if(NOT WITH_LLVM)
message(FATAL_ERROR "Cycles OSL reqires WITH_LLVM, the library may not have been found. Configure LLVM or disable WITH_CYCLES_OSL") message(FATAL_ERROR "Cycles OSL reqires WITH_LLVM, the library may not have been found. Configure LLVM or disable WITH_CYCLES_OSL")
endif() endif()

@ -887,7 +887,9 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
dllsources.append('${LCGDIR}/thumbhandler/lib/BlendThumb64.dll') dllsources.append('${LCGDIR}/thumbhandler/lib/BlendThumb64.dll')
if env['WITH_BF_OIIO'] and env['OURPLATFORM'] != 'win32-mingw': if env['WITH_BF_OIIO'] and env['OURPLATFORM'] != 'win32-mingw':
dllsources.append('${LCGDIR}/openimageio/bin/OpenImageIO.dll') dllpath = '${LCGDIR}/openimageio/bin/OpenImageIO.dll'
if os.path.exists(env.subst(dllpath)):
dllsources.append(dllpath)
if env['WITH_BF_OCIO']: if env['WITH_BF_OCIO']:
if not env['OURPLATFORM'] in ('win32-mingw', 'linuxcross'): if not env['OURPLATFORM'] in ('win32-mingw', 'linuxcross'):

@ -700,7 +700,11 @@ macro(delayed_install
destination) destination)
foreach(f ${files}) foreach(f ${files})
if(IS_ABSOLUTE ${f})
set_property(GLOBAL APPEND PROPERTY DELAYED_INSTALL_FILES ${f})
else()
set_property(GLOBAL APPEND PROPERTY DELAYED_INSTALL_FILES ${base}/${f}) set_property(GLOBAL APPEND PROPERTY DELAYED_INSTALL_FILES ${base}/${f})
endif()
set_property(GLOBAL APPEND PROPERTY DELAYED_INSTALL_DESTINATIONS ${destination}) set_property(GLOBAL APPEND PROPERTY DELAYED_INSTALL_DESTINATIONS ${destination})
endforeach() endforeach()
endmacro() endmacro()

@ -217,7 +217,7 @@ C_WARN = []
CC_WARN = [] CC_WARN = []
CXX_WARN = [] CXX_WARN = []
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid'] LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi']
PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:IX86','/STACK:2097152','/INCREMENTAL:NO', '/LARGEADDRESSAWARE', '/NODEFAULTLIB:msvcrt.lib', '/NODEFAULTLIB:msvcmrt.lib', '/NODEFAULTLIB:msvcurt.lib', '/NODEFAULTLIB:msvcrtd.lib'] PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:IX86','/STACK:2097152','/INCREMENTAL:NO', '/LARGEADDRESSAWARE', '/NODEFAULTLIB:msvcrt.lib', '/NODEFAULTLIB:msvcmrt.lib', '/NODEFAULTLIB:msvcurt.lib', '/NODEFAULTLIB:msvcrtd.lib']

@ -79,12 +79,13 @@ def update_script_node(node, report):
if script.is_in_memory or script.is_dirty or script.is_modified or not os.path.exists(osl_path): if script.is_in_memory or script.is_dirty or script.is_modified or not os.path.exists(osl_path):
# write text datablock contents to temporary file # write text datablock contents to temporary file
osl_file = tempfile.NamedTemporaryFile(mode='w', suffix=".osl", delete=True) osl_file = tempfile.NamedTemporaryFile(mode='w', suffix=".osl", delete=False)
osl_file.write(script.as_string()) osl_file.write(script.as_string())
osl_file.flush() osl_file.close()
ok, oso_path = osl_compile(osl_file.name, report) ok, oso_path = osl_compile(osl_file.name, report)
oso_file_remove = False oso_file_remove = False
osl_file.close() os.remove(osl_file.name)
else: else:
# compile text datablock from disk directly # compile text datablock from disk directly
ok, oso_path = osl_compile(osl_path, report) ok, oso_path = osl_compile(osl_path, report)

@ -621,11 +621,11 @@ elseif(WIN32)
) )
if(WITH_OPENIMAGEIO) if(WITH_OPENIMAGEIO)
if(NOT MINGW) set(OIIODLL ${LIBDIR}/openimageio/bin/OpenImageIO.dll)
set(OIIOBIN ${LIBDIR}/openimageio/bin) if(NOT MINGW AND EXISTS ${OIIODLL})
install( install(
FILES FILES
${OIIOBIN}/OpenImageIO.dll ${OIIODLL}
DESTINATION ${TARGETDIR} DESTINATION ${TARGETDIR}
) )
endif() endif()
@ -648,20 +648,6 @@ elseif(WIN32)
endif() endif()
endif() endif()
if(WITH_CYCLES AND WITH_CYCLES_OSL)
if(NOT MINGW)
set(OSLBIN ${LIBDIR}/osl/bin)
install(
FILES
${OSLBIN}/oslexec.dll
${OSLBIN}/oslquery.dll
${OSLBIN}/oslcomp.dll
DESTINATION ${TARGETDIR}
)
endif()
endif()
elseif(APPLE) elseif(APPLE)
# handy install macro to exclude files, we use \$ escape for the "to" # handy install macro to exclude files, we use \$ escape for the "to"