Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-10-20 16:17:45 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-10-20 16:17:45 +0400
commit3abef3a2e6b77949f2e992baefd660422e3e19fe (patch)
tree4559b84faedd744d6a64508b0c75fecd82121404
parent1820d3529c7fe37d4a03aca975881c4fc4304f38 (diff)
Cycles OSL: some build system tweaks to avoid global includes and definitions,
which ensures there is no conflict with other libraries, and avoids full rebuild when toggling OSL on/off.
-rw-r--r--CMakeLists.txt28
-rw-r--r--intern/cycles/CMakeLists.txt1
-rw-r--r--intern/cycles/kernel/osl/nodes/CMakeLists.txt2
3 files changed, 4 insertions, 27 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 38e3c5b2b01..1903a2ad406 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -734,23 +734,14 @@ if(UNIX AND NOT APPLE)
execute_process(COMMAND ${LLVM_CONFIG} --libdir
OUTPUT_VARIABLE LLVM_LIB_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
- execute_process(COMMAND ${LLVM_CONFIG} --includedir
- OUTPUT_VARIABLE LLVM_INCLUDES
- OUTPUT_STRIP_TRAILING_WHITESPACE)
find_library(LLVM_LIBRARY
NAMES libLLVMAnalysis.a # first of a whole bunch of libs to get
PATHS ${LLVM_LIB_DIR})
message(STATUS "LLVM version = ${LLVM_VERSION}")
message(STATUS "LLVM dir = ${LLVM_DIRECTORY}")
- message(STATUS "LLVM includes = ${LLVM_INCLUDES}")
message(STATUS "LLVM lib dir = ${LLVM_LIB_DIR}")
- if(LLVM_LIBRARY AND LLVM_INCLUDES AND LLVM_DIRECTORY AND LLVM_LIB_DIR)
- # ensure include directory is added (in case of non-standard locations
- include_directories(BEFORE "${LLVM_INCLUDES}")
- string(REGEX REPLACE "\\." "" OSL_LLVM_VERSION ${LLVM_VERSION})
- message(STATUS "LLVM OSL_LLVM_VERSION = ${OSL_LLVM_VERSION}")
- add_definitions("-DOSL_LLVM_VERSION=${OSL_LLVM_VERSION}")
+ if(LLVM_LIBRARY AND LLVM_DIRECTORY AND LLVM_LIB_DIR)
if(LLVM_STATIC)
# if static LLVM libraries were requested, use llvm-config to generate
# the list of what libraries we need, and substitute that in the right
@@ -788,8 +779,6 @@ if(UNIX AND NOT APPLE)
else()
message(STATUS "OSL not found")
endif()
-
- include_directories(${OSL_INCLUDES})
endif()
# OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed
@@ -957,8 +946,6 @@ elseif(WIN32)
else()
message(STATUS "OSL not found")
endif()
-
- include_directories(${OSL_INCLUDES})
endif()
if(MSVC)
@@ -1640,23 +1627,14 @@ elseif(APPLE)
execute_process(COMMAND ${LLVM_CONFIG} --libdir
OUTPUT_VARIABLE LLVM_LIB_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
- execute_process(COMMAND ${LLVM_CONFIG} --includedir
- OUTPUT_VARIABLE LLVM_INCLUDES
- OUTPUT_STRIP_TRAILING_WHITESPACE)
find_library(LLVM_LIBRARY
NAMES libLLVMAnalysis.a # first of a whole bunch of libs to get
PATHS ${LLVM_LIB_DIR})
message(STATUS "LLVM version = ${LLVM_VERSION}")
message(STATUS "LLVM dir = ${LLVM_DIRECTORY}")
- message(STATUS "LLVM includes = ${LLVM_INCLUDES}")
message(STATUS "LLVM lib dir = ${LLVM_LIB_DIR}")
- if(LLVM_LIBRARY AND LLVM_INCLUDES AND LLVM_DIRECTORY AND LLVM_LIB_DIR)
- # ensure include directory is added (in case of non-standard locations
- include_directories(BEFORE "${LLVM_INCLUDES}")
- string(REGEX REPLACE "\\." "" OSL_LLVM_VERSION ${LLVM_VERSION})
- message(STATUS "LLVM OSL_LLVM_VERSION = ${OSL_LLVM_VERSION}")
- add_definitions("-DOSL_LLVM_VERSION=${OSL_LLVM_VERSION}")
+ if(LLVM_LIBRARY AND LLVM_DIRECTORY AND LLVM_LIB_DIR)
if(LLVM_STATIC)
# if static LLVM libraries were requested, use llvm-config to generate
# the list of what libraries we need, and substitute that in the right
@@ -1693,8 +1671,6 @@ elseif(APPLE)
else()
message(STATUS "OSL not found")
endif()
-
- include_directories(${OSL_INCLUDES})
endif()
set(EXETYPE MACOSX_BUNDLE)
diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt
index 38daf790955..7562ee0a0a5 100644
--- a/intern/cycles/CMakeLists.txt
+++ b/intern/cycles/CMakeLists.txt
@@ -41,6 +41,7 @@ endif()
if(WITH_CYCLES_OSL)
add_definitions(-DWITH_OSL)
+ include_directories(${OSL_INCLUDES})
endif()
if(WITH_CYCLES_PARTIO)
diff --git a/intern/cycles/kernel/osl/nodes/CMakeLists.txt b/intern/cycles/kernel/osl/nodes/CMakeLists.txt
index 65b8504ce43..faf7941ee5e 100644
--- a/intern/cycles/kernel/osl/nodes/CMakeLists.txt
+++ b/intern/cycles/kernel/osl/nodes/CMakeLists.txt
@@ -88,7 +88,7 @@ foreach(_file ${SRC_OSL})
unset(_OSO_FILE)
endforeach()
-add_custom_target(shader ALL DEPENDS ${SRC_OSO} ${SRC_OSL_HEADERS})
+add_custom_target(cycles_osl_shaders ALL DEPENDS ${SRC_OSO} ${SRC_OSL_HEADERS})
# CMAKE_CURRENT_SOURCE_DIR is already included in OSO paths
delayed_install("" "${SRC_OSO}" ${CYCLES_INSTALL_PATH}/shader)