From 2afdc15709ba280ab552acaebf16d8bc41d0697b Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 9 Aug 2023 19:53:11 +0200 Subject: [PATCH] Build: patch OSL to avoid duplicate symbols in static libraries This was revealed by CMake refactoring in #110394, with the solution identified by Ray Molenkamp. Upstream: https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1709 Pull Request: https://projects.blender.org/blender/blender/pulls/110974 --- build_files/build_environment/patches/osl.diff | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/build_files/build_environment/patches/osl.diff b/build_files/build_environment/patches/osl.diff index 8578a1b782b..032303c5ca7 100644 --- a/build_files/build_environment/patches/osl.diff +++ b/build_files/build_environment/patches/osl.diff @@ -75,3 +75,18 @@ index 46e4529..8e86486 100644 return false; } +diff --git a/src/liboslexec/CMakeLists.txt b/src/liboslexec/CMakeLists.txt +index 6bb0d175..19f13513 100644 +--- a/src/liboslexec/CMakeLists.txt ++++ b/src/liboslexec/CMakeLists.txt +@@ -148,7 +148,9 @@ file (GLOB exec_headers "*.h") + file (GLOB compiler_headers "../liboslcomp/*.h") + + FLEX_BISON ( osolex.l osogram.y oso lib_src exec_headers ) +-FLEX_BISON ( ../liboslcomp/osllex.l ../liboslcomp/oslgram.y osl lib_src compiler_headers ) ++if (BUILD_SHARED_LIBS) ++ FLEX_BISON ( ../liboslcomp/osllex.l ../liboslcomp/oslgram.y osl lib_src compiler_headers ) ++endif() + + set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS" ) +