Fix: Cycles, missing OSL headers in install

Some headers and precompiled shaders were not properly installed.
This seems to be a regression since !153424: our custom FindOSL
used to define OSL_SHADER_DIR. It is not defined by the CMake
configs from the OSL.

Pull Request: https://projects.blender.org/blender/blender/pulls/154576
This commit is contained in:
Sergey Sharybin 2026-02-19 14:45:07 +01:00 • committed by Sergey Sharybin
parent f05fea4d7f
commit 3a0682c527

View file

@ -107,6 +107,30 @@ set(SRC_OSL
node_rgb_to_bw.osl
)
get_filename_component(OSL_SHADER_HINT ${OSL_COMPILER} DIRECTORY)
find_path(OSL_SHADER_DIR
NAMES
stdosl.h
HINTS
${OSL_SHADER_HINT}
${OSL_SHADER_HINT}/../
${OSL_ROOT_DIR}
${OSL_HOME_DIR}
/usr/share/OSL/
/usr/include/OSL/
PATH_SUFFIXES
share/OSL/shaders
shaders
)
if(NOT EXISTS "${OSL_SHADER_DIR}")
if(WITH_STRICT_BUILD_OPTIONS)
message(SEND_ERROR "Precompiled OSL shader headers are not found, stopping")
else()
message(STATUS "Precompiled OSL shader headers are not found, continuing without")
endif()
endif()
# The headers that OSL ships differs per release so we can not
# hard-code this.
file(GLOB SRC_OSL_HEADER_DIST ${OSL_SHADER_DIR}/*.h)