Cycles: Synchronize changes with standalone repository
This changes were done in original commit of the standalone Cycles repository and needed here for easier patch synchronization.
This commit is contained in:
@@ -1076,10 +1076,10 @@ if(UNIX AND NOT APPLE)
|
||||
# Note: --whole-archive is needed to force loading of all symbols in liboslexec,
|
||||
# otherwise LLVM is missing the osl_allocate_closure_component function
|
||||
list(APPEND OSL_LIBRARIES ${OSL_LIB_COMP} -Wl,--whole-archive ${OSL_LIB_EXEC} -Wl,--no-whole-archive ${OSL_LIB_QUERY})
|
||||
find_path(OSL_INCLUDES OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
|
||||
find_path(OSL_INCLUDE_DIR OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
|
||||
find_program(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin)
|
||||
|
||||
if(OSL_INCLUDES AND OSL_LIBRARIES AND OSL_COMPILER)
|
||||
if(OSL_INCLUDE_DIR AND OSL_LIBRARIES AND OSL_COMPILER)
|
||||
set(OSL_FOUND TRUE)
|
||||
else()
|
||||
message(STATUS "OSL not found")
|
||||
@@ -1760,10 +1760,10 @@ elseif(WIN32)
|
||||
find_library(OSL_LIB_COMP_DEBUG NAMES oslcomp_d PATHS ${CYCLES_OSL}/lib)
|
||||
find_library(OSL_LIB_QUERY_DEBUG NAMES oslquery_d PATHS ${CYCLES_OSL}/lib)
|
||||
list(APPEND OSL_LIBRARIES optimized ${OSL_LIB_COMP} optimized ${OSL_LIB_EXEC} optimized ${OSL_LIB_QUERY} debug ${OSL_LIB_EXEC_DEBUG} debug ${OSL_LIB_COMP_DEBUG} debug ${OSL_LIB_QUERY_DEBUG})
|
||||
find_path(OSL_INCLUDES OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
|
||||
find_path(OSL_INCLUDE_DIR OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
|
||||
find_program(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin)
|
||||
|
||||
if(OSL_INCLUDES AND OSL_LIBRARIES AND OSL_COMPILER)
|
||||
if(OSL_INCLUDE_DIR AND OSL_LIBRARIES AND OSL_COMPILER)
|
||||
set(OSL_FOUND TRUE)
|
||||
else()
|
||||
message(STATUS "OSL not found")
|
||||
@@ -2054,10 +2054,10 @@ elseif(APPLE)
|
||||
find_library(OSL_LIB_QUERY NAMES oslquery PATHS ${CYCLES_OSL}/lib)
|
||||
# WARNING! depends on correct order of OSL libs linking
|
||||
list(APPEND OSL_LIBRARIES ${OSL_LIB_COMP} -force_load ${OSL_LIB_EXEC} ${OSL_LIB_QUERY})
|
||||
find_path(OSL_INCLUDES OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
|
||||
find_path(OSL_INCLUDE_DIR OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
|
||||
find_program(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin)
|
||||
|
||||
if(OSL_INCLUDES AND OSL_LIBRARIES AND OSL_COMPILER)
|
||||
if(OSL_INCLUDE_DIR AND OSL_LIBRARIES AND OSL_COMPILER)
|
||||
set(OSL_FOUND TRUE)
|
||||
else()
|
||||
message(STATUS "OSL not found")
|
||||
@@ -2629,7 +2629,7 @@ mark_as_advanced(
|
||||
OSL_COMPILER
|
||||
OSL_LIB_COMP
|
||||
OSL_LIB_QUERY
|
||||
OSL_INCLUDES
|
||||
OSL_INCLUDE_DIR
|
||||
)
|
||||
|
||||
mark_as_advanced(
|
||||
|
@@ -120,7 +120,7 @@ if(WITH_CYCLES_OSL)
|
||||
add_definitions(-DOSL_STATIC_LIBRARY)
|
||||
include_directories(
|
||||
SYSTEM
|
||||
${OSL_INCLUDES}
|
||||
${OSL_INCLUDE_DIR}
|
||||
)
|
||||
endif()
|
||||
|
||||
|
@@ -22,7 +22,6 @@ set(LIBRARIES
|
||||
${BOOST_LIBRARIES}
|
||||
${OPENEXR_LIBRARIES}
|
||||
${BLENDER_GL_LIBRARIES}
|
||||
bf_intern_glew_mx
|
||||
${CYCLES_APP_GLEW_LIBRARY}
|
||||
${OPENIMAGEIO_LIBRARIES}
|
||||
${PNG_LIBRARIES}
|
||||
@@ -33,20 +32,30 @@ set(LIBRARIES
|
||||
extern_cuew
|
||||
)
|
||||
|
||||
if(NOT CYCLES_STANDALONE_REPOSITORY)
|
||||
list(APPEND LIBRARIES bf_intern_glew_mx)
|
||||
endif()
|
||||
|
||||
add_definitions(${GL_DEFINITIONS})
|
||||
|
||||
if(WIN32)
|
||||
list(APPEND LIBRARIES ${PTHREADS_LIBRARIES})
|
||||
endif()
|
||||
|
||||
link_directories(${OPENIMAGEIO_LIBPATH} ${BOOST_LIBPATH} ${PNG_LIBPATH} ${JPEG_LIBPATH} ${ZLIB_LIBPATH} ${TIFF_LIBPATH})
|
||||
link_directories(${OPENIMAGEIO_LIBPATH}
|
||||
${BOOST_LIBPATH}
|
||||
${PNG_LIBPATH}
|
||||
${JPEG_LIBPATH}
|
||||
${ZLIB_LIBPATH}
|
||||
${TIFF_LIBPATH}
|
||||
${OPENEXR_LIBPATH})
|
||||
|
||||
if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI)
|
||||
list(APPEND LIBRARIES ${GLUT_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(WITH_CYCLES_OSL)
|
||||
list(APPEND LIBRARIES cycles_kernel_osl ${OSL_LIBRARIES} ${LLVM_LIBRARY})
|
||||
list(APPEND LIBRARIES cycles_kernel_osl ${OSL_LIBRARIES} ${LLVM_LIBRARIES})
|
||||
endif()
|
||||
|
||||
include_directories(${INC})
|
||||
|
@@ -17,7 +17,7 @@ set(INC
|
||||
|
||||
set(INC_SYS
|
||||
${PYTHON_INCLUDE_DIRS}
|
||||
${GLEW_INCLUDE_PATH}
|
||||
${GLEW_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
set(SRC
|
||||
|
@@ -16,6 +16,11 @@ endif()
|
||||
###########################################################################
|
||||
# GLEW
|
||||
|
||||
# Workaround for unconventional variable name use in Blender.
|
||||
if(NOT CYCLES_STANDALONE_REPOSITORY)
|
||||
set(GLEW_INCLUDE_DIR "${GLEW_INCLUDE_PATH}")
|
||||
endif()
|
||||
|
||||
if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI)
|
||||
set(CYCLES_APP_GLEW_LIBRARY ${BLENDER_GLEW_LIBRARIES})
|
||||
endif()
|
||||
@@ -32,3 +37,65 @@ if(WITH_CYCLES_CUDA_BINARIES)
|
||||
set(WITH_CYCLES_CUDA_BINARIES OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Packages which are being found by Blender when building from inside Blender
|
||||
# source code. but which we need to take care of when building Cycles from a
|
||||
# standalone repository
|
||||
if(CYCLES_STANDALONE_REPOSITORY)
|
||||
if(APPLE OR WIN32)
|
||||
include(precompiled_libs)
|
||||
endif()
|
||||
|
||||
####
|
||||
# OpenGL
|
||||
|
||||
# TODO(sergey): We currently re-use the same variable name as we use
|
||||
# in Blender. Ideally we need to make it CYCLES_GL_LIBRARIES.
|
||||
find_package(OpenGL REQUIRED)
|
||||
find_package(GLEW REQUIRED)
|
||||
list(APPEND BLENDER_GL_LIBRARIES
|
||||
"${OPENGL_gl_LIBRARY}"
|
||||
"${OPENGL_glu_LIBRARY}"
|
||||
"${GLEW_LIBRARY}"
|
||||
)
|
||||
|
||||
####
|
||||
# OpenImageIO
|
||||
find_package(OpenImageIO REQUIRED)
|
||||
|
||||
# OIIO usually depends on OpenEXR, so find this library
|
||||
# but don't make it required.
|
||||
find_package(OpenEXR)
|
||||
|
||||
####
|
||||
# Boost
|
||||
set(__boost_packages filesystem regex system thread date_time)
|
||||
if(WITH_CYCLES_NETWORK)
|
||||
list(APPEND __boost_packages serialization)
|
||||
endif()
|
||||
if(WITH_CYCLES_OSL AND APPLE)
|
||||
list(APPEND __boost_packages wave)
|
||||
endif()
|
||||
find_package(Boost 1.48 COMPONENTS ${__boost_packages} REQUIRED)
|
||||
if(NOT Boost_FOUND)
|
||||
# Try to find non-multithreaded if -mt not found, this flag
|
||||
# doesn't matter for us, it has nothing to do with thread
|
||||
# safety, but keep it to not disturb build setups.
|
||||
set(Boost_USE_MULTITHREADED OFF)
|
||||
find_package(Boost 1.48 COMPONENTS ${__boost_packages})
|
||||
endif()
|
||||
unset(__boost_packages)
|
||||
set(BOOST_INCLUDE_DIR ${Boost_INCLUDE_DIRS})
|
||||
set(BOOST_LIBRARIES ${Boost_LIBRARIES})
|
||||
set(BOOST_LIBPATH ${Boost_LIBRARY_DIRS})
|
||||
set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB")
|
||||
|
||||
####
|
||||
# OpenShadingLanguage
|
||||
if(WITH_CYCLES_OSL)
|
||||
find_package(OpenShadingLanguage REQUIRED)
|
||||
find_package(LLVM REQUIRED)
|
||||
endif()
|
||||
|
||||
unset(_lib_DIR)
|
||||
endif()
|
||||
|
@@ -10,7 +10,7 @@ set(INC
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
${GLEW_INCLUDE_PATH}
|
||||
${GLEW_INCLUDE_DIR}
|
||||
../../../extern/cuew/include
|
||||
../../../extern/clew/include
|
||||
)
|
||||
|
@@ -11,7 +11,7 @@ set(INC
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
${GLEW_INCLUDE_PATH}
|
||||
${GLEW_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
set(SRC
|
||||
|
@@ -5,7 +5,7 @@ set(INC
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
${GLEW_INCLUDE_PATH}
|
||||
${GLEW_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
set(SRC
|
||||
|
Reference in New Issue
Block a user