[compiler-rt] [compiler-rt][cmake] Add option to control shared library builds (PR #139042)

Sam Clegg via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 16 17:53:59 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()
----------------
sbc100 wrote:

Ah OK, that makes sense.   

Now I'm wondering if we should be somehow setting `BUILD_SHARED_LIBS` at the point where we set `CMAKE_SYSTEM_NAME` to WASI?   @dschuff I guess `BUILD_SHARED_LIBS` can have different values for the compiler built itself and for each to the target system which compiler-rt is being built for?   So maybe it is OK to use `BUILD_SHARED_LIBS`?

https://github.com/llvm/llvm-project/pull/139042


More information about the llvm-commits mailing list