diff options
author | Ray Molenkamp <github@lazydodo.com> | 2020-02-17 20:28:12 +0300 |
---|---|---|
committer | Ray Molenkamp <github@lazydodo.com> | 2020-02-17 20:28:12 +0300 |
commit | 8d60e6fa387891dd3879183b502e636e1e86b594 (patch) | |
tree | 3f321f08b2b944e12a29c92a29561acd4c1f8e59 /intern/cycles/kernel | |
parent | a33b261473e95de8d8d438dbb6aa7afe513fb082 (diff) |
Fix: T73830 OSL not finding stdosl.h on linux
This extends FindOpenShadingLanguage.cmake to also look for the location of
stdosl.h and adds the path to the invocation of oslc to deal with the headers
being in different locations a little better.
Differential Revision: https://developer.blender.org/D6865
Reviewers: brecht
Diffstat (limited to 'intern/cycles/kernel')
-rw-r--r-- | intern/cycles/kernel/shaders/CMakeLists.txt | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/intern/cycles/kernel/shaders/CMakeLists.txt b/intern/cycles/kernel/shaders/CMakeLists.txt index 958ebe2f04e..9dcedc9ba19 100644 --- a/intern/cycles/kernel/shaders/CMakeLists.txt +++ b/intern/cycles/kernel/shaders/CMakeLists.txt @@ -96,15 +96,6 @@ set(SRC_OSL node_rgb_to_bw.osl ) -# FindOSL.cmake does not give us the location of the shader library -# but generally it can be figured out from the location of the oslc -# compiler. However if this fails you can set OSL_SHADER_DIR to -# bypass the auto discovery. -if(NOT DEFINED OSL_SHADER_DIR) - get_filename_component(OSL_SHADER_DIR ${OSL_COMPILER} DIRECTORY) - get_filename_component(OSL_SHADER_DIR ${OSL_SHADER_DIR}/../shaders ABSOLUTE) -endif() - # The headers that OSL ships differs per release so we can not # hardcode this. file(GLOB SRC_OSL_HEADER_DIST ${OSL_SHADER_DIR}/*.h) @@ -132,7 +123,7 @@ foreach(_file ${SRC_OSL}) string(REPLACE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} _OSO_FILE ${_OSO_FILE}) add_custom_command( OUTPUT ${_OSO_FILE} - COMMAND ${OSL_COMPILER} -q -O2 -I"${CMAKE_CURRENT_SOURCE_DIR}" -o ${_OSO_FILE} ${_OSL_FILE} + COMMAND ${OSL_COMPILER} -q -O2 -I"${CMAKE_CURRENT_SOURCE_DIR}" -I"${OSL_SHADER_DIR}" -o ${_OSO_FILE} ${_OSL_FILE} DEPENDS ${_OSL_FILE} ${SRC_OSL_HEADERS} ${OSL_COMPILER}) list(APPEND SRC_OSO ${_OSO_FILE} |