[compiler-rt] [compiler-rt][cmake] Add option to control shared library builds (PR #139042)
Petr Hosek via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 4 15:39:51 PDT 2025
================
@@ -91,6 +91,13 @@ mark_as_advanced(COMPILER_RT_SCUDO_STANDALONE_BUILD_SHARED)
option(COMPILER_RT_BUILD_SCUDO_STANDALONE_WITH_LLVM_LIBC "Build SCUDO standalone with LLVM's libc headers" OFF)
mark_as_advanced(COMPILER_RT_BUILD_SCUDO_STANDALONE_WITH_LLVM_LIBC)
+set(COMPILER_RT_BUILD_SHARED_LIBS_DEFAULT ON)
+if(CMAKE_SYSTEM_NAME STREQUAL "WASI")
+ set(COMPILER_RT_BUILD_SHARED_LIBS_DEFAULT OFF)
+endif()
----------------
petrhosek wrote:
Using `BUILD_SHARED_LIBS` is the correct way. `LLVM_ENABLE_PROJECTS=compiler-rt` is not the right way to build compiler-rt for the host platform and we'll be [removing support for building compiler-rt that way after LLVM 21 branches](https://github.com/llvm/llvm-project/blob/83fbd86909111510f973d8e1c4214022368ef810/llvm/CMakeLists.txt#L188-L193).
https://github.com/llvm/llvm-project/pull/139042
More information about the llvm-commits
mailing list