From 810bfcc30a93b34bd950cf055146c3cdb9df9ba1 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 29 Mar 2024 14:49:51 +0100 Subject: [PATCH] Build: Improve OSL library dependency handling in Cycles Might fix some missing symbols when the OSL library gets updated. Pull Request: https://projects.blender.org/blender/blender/pulls/119391 --- intern/cycles/CMakeLists.txt | 4 ---- intern/cycles/blender/CMakeLists.txt | 6 ++++++ intern/cycles/device/CMakeLists.txt | 7 +++++++ intern/cycles/scene/CMakeLists.txt | 1 + 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt index 080d2ef79dc..b586a7c6b16 100644 --- a/intern/cycles/CMakeLists.txt +++ b/intern/cycles/CMakeLists.txt @@ -224,10 +224,6 @@ endif() if(WITH_CYCLES_OSL) add_definitions(-DWITH_OSL) - # osl 1.9.x - add_definitions(-DOSL_STATIC_BUILD) - # pre 1.9 - add_definitions(-DOSL_STATIC_LIBRARY) include_directories( SYSTEM ${OSL_INCLUDE_DIR} diff --git a/intern/cycles/blender/CMakeLists.txt b/intern/cycles/blender/CMakeLists.txt index 517ce4c6407..c8faca4175c 100644 --- a/intern/cycles/blender/CMakeLists.txt +++ b/intern/cycles/blender/CMakeLists.txt @@ -142,6 +142,12 @@ if(WITH_OPENIMAGEDENOISE) ) endif() +if(WITH_CYCLES_OSL) + list(APPEND LIB + ${OSL_LIBRARIES} + ) +endif() + blender_add_lib(bf_intern_cycles "${SRC}" "${INC}" "${INC_SYS}" "${LIB}") add_dependencies(bf_intern_cycles bf_rna) diff --git a/intern/cycles/device/CMakeLists.txt b/intern/cycles/device/CMakeLists.txt index 7d2cac41b8c..e2939ef08da 100644 --- a/intern/cycles/device/CMakeLists.txt +++ b/intern/cycles/device/CMakeLists.txt @@ -203,6 +203,13 @@ if(WITH_OPENIMAGEDENOISE) ) endif() +if(WITH_CYCLES_OSL) + list(APPEND LIB + ${OSL_LIBRARIES} + ) +endif() + + include_directories(${INC}) include_directories(SYSTEM ${INC_SYS}) diff --git a/intern/cycles/scene/CMakeLists.txt b/intern/cycles/scene/CMakeLists.txt index ce4093cdf03..874b38525ed 100644 --- a/intern/cycles/scene/CMakeLists.txt +++ b/intern/cycles/scene/CMakeLists.txt @@ -107,6 +107,7 @@ endif() if(WITH_CYCLES_OSL) list(APPEND LIB cycles_kernel_osl + ${OSL_LIBRARIES} ) endif()