From 088ae8d905f4f4d3e7d366cd4a85988d40c75373 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 14 Feb 2024 12:06:52 +0100 Subject: [PATCH] Build: Remove LLVM linking no longer needed by OSL These are now included in the OSL shared libraries, so no reason to link against it. The CMake code for WITH_LLVM remains in case it is useful in the future, but is not enabled by any Blender feature now. Pull Request: https://projects.blender.org/blender/blender/pulls/118229 --- CMakeLists.txt | 28 ++----------------------- intern/cycles/cmake/macros.cmake | 2 +- intern/cycles/kernel/osl/CMakeLists.txt | 2 -- 3 files changed, 3 insertions(+), 29 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7460f0282ce..603f828b718 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -703,12 +703,7 @@ mark_as_advanced(WITH_DRAW_DEBUG) # LLVM option(WITH_LLVM "Use LLVM" OFF) -if(APPLE) - # We prefer static llvm build on Apple, dyn build possible though. - option(LLVM_STATIC "Link with LLVM static libraries" ON) -else() - option(LLVM_STATIC "Link with LLVM static libraries" OFF) -endif() +option(LLVM_STATIC "Link with LLVM static libraries" OFF) mark_as_advanced(LLVM_STATIC) option(WITH_CLANG "Use Clang" OFF) @@ -1156,14 +1151,7 @@ set_and_warn_dependency(WITH_IMAGE_OPENEXR WITH_CYCLES_OSL OFF) # Hydra requires USD. set_and_warn_dependency(WITH_USD WITH_HYDRA OFF) -# auto enable openimageio for cycles -if(WITH_CYCLES) - # auto enable llvm for cycles_osl - if(WITH_CYCLES_OSL) - set(WITH_LLVM ON CACHE BOOL "" FORCE) - set(WITH_CLANG ON CACHE BOOL "" FORCE) - endif() -else() +if(NOT WITH_CYCLES) set(WITH_CYCLES_OSL OFF) endif() @@ -1382,18 +1370,6 @@ if(NOT WITH_FFTW3 AND WITH_MOD_OCEANSIM) message(FATAL_ERROR "WITH_MOD_OCEANSIM requires WITH_FFTW3 to be ON") endif() -if(WITH_CYCLES) - if(WITH_CYCLES_OSL) - if(NOT WITH_LLVM) - message( - FATAL_ERROR - "Cycles OSL requires WITH_LLVM, the library may not have been found. " - "Configure LLVM or disable WITH_CYCLES_OSL" - ) - endif() - endif() -endif() - if(WITH_INTERNATIONAL) if(NOT WITH_BOOST) message( diff --git a/intern/cycles/cmake/macros.cmake b/intern/cycles/cmake/macros.cmake index 1dba462d273..caa10a3a5d5 100644 --- a/intern/cycles/cmake/macros.cmake +++ b/intern/cycles/cmake/macros.cmake @@ -93,7 +93,7 @@ macro(cycles_external_libraries_append libraries) list(APPEND ${libraries} ${GLOG_LIBRARIES} ${GFLAGS_LIBRARIES}) endif() if(WITH_CYCLES_OSL) - list(APPEND ${libraries} ${OSL_LIBRARIES} ${CLANG_LIBRARIES} ${LLVM_LIBRARY}) + list(APPEND ${libraries} ${OSL_LIBRARIES}) endif() if(WITH_CYCLES_EMBREE) list(APPEND ${libraries} ${EMBREE_LIBRARIES}) diff --git a/intern/cycles/kernel/osl/CMakeLists.txt b/intern/cycles/kernel/osl/CMakeLists.txt index 653ed660dc7..7b30794d03e 100644 --- a/intern/cycles/kernel/osl/CMakeLists.txt +++ b/intern/cycles/kernel/osl/CMakeLists.txt @@ -32,8 +32,6 @@ set(LIB ${OSL_LIBRARIES} ${OPENIMAGEIO_LIBRARIES} ${PUGIXML_LIBRARIES} - ${CLANG_LIBRARIES} - ${LLVM_LIBRARY} ) if(APPLE)