forked from bartvdbraak/blender
Cycles OSL: windows build system changes to support static OSL/OIIO.
This commit is contained in:
parent
1c9b548d92
commit
2324c80f50
@ -403,7 +403,7 @@ if(WITH_CYCLES OR WITH_MOD_BOOLEAN OR WITH_AUDASPACE OR WITH_INTERNATIONAL)
|
||||
endif()
|
||||
|
||||
# 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)
|
||||
endif()
|
||||
|
||||
@ -942,6 +942,13 @@ elseif(WIN32)
|
||||
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)
|
||||
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")
|
||||
endif()
|
||||
|
||||
if(WITH_CYCLES_OSL AND NOT WIN32)
|
||||
if(WITH_CYCLES_OSL)
|
||||
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")
|
||||
endif()
|
||||
|
@ -887,7 +887,9 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
|
||||
dllsources.append('${LCGDIR}/thumbhandler/lib/BlendThumb64.dll')
|
||||
|
||||
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 not env['OURPLATFORM'] in ('win32-mingw', 'linuxcross'):
|
||||
|
@ -700,7 +700,11 @@ macro(delayed_install
|
||||
destination)
|
||||
|
||||
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})
|
||||
endif()
|
||||
set_property(GLOBAL APPEND PROPERTY DELAYED_INSTALL_DESTINATIONS ${destination})
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
@ -217,7 +217,7 @@ C_WARN = []
|
||||
CC_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']
|
||||
|
||||
|
@ -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):
|
||||
# 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.flush()
|
||||
osl_file.close()
|
||||
|
||||
ok, oso_path = osl_compile(osl_file.name, report)
|
||||
oso_file_remove = False
|
||||
osl_file.close()
|
||||
os.remove(osl_file.name)
|
||||
else:
|
||||
# compile text datablock from disk directly
|
||||
ok, oso_path = osl_compile(osl_path, report)
|
||||
|
@ -621,11 +621,11 @@ elseif(WIN32)
|
||||
)
|
||||
|
||||
if(WITH_OPENIMAGEIO)
|
||||
if(NOT MINGW)
|
||||
set(OIIOBIN ${LIBDIR}/openimageio/bin)
|
||||
set(OIIODLL ${LIBDIR}/openimageio/bin/OpenImageIO.dll)
|
||||
if(NOT MINGW AND EXISTS ${OIIODLL})
|
||||
install(
|
||||
FILES
|
||||
${OIIOBIN}/OpenImageIO.dll
|
||||
${OIIODLL}
|
||||
DESTINATION ${TARGETDIR}
|
||||
)
|
||||
endif()
|
||||
@ -648,20 +648,6 @@ elseif(WIN32)
|
||||
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)
|
||||
|
||||
# handy install macro to exclude files, we use \$ escape for the "to"
|
||||
|
Loading…
Reference in New Issue
Block a user