Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions compiler-rt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ 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)

option(COMPILER_RT_BUILD_SHARED_LIBS "Build all libraries as shared libraries in addition to static libraries" ON)
mark_as_advanced(COMPILER_RT_BUILD_SHARED_LIBS)

if(FUCHSIA)
set(COMPILER_RT_HWASAN_WITH_INTERCEPTORS_DEFAULT OFF)
else()
Expand Down
4 changes: 4 additions & 0 deletions compiler-rt/cmake/Modules/AddCompilerRT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ function(add_compiler_rt_runtime name type)
"type argument must be OBJECT, STATIC, SHARED or MODULE")
return()
endif()
if(type STREQUAL "SHARED" AND NOT COMPILER_RT_BUILD_SHARED_LIBS)
message(STATUS "Skipping shared library ${name} because COMPILER_RT_BUILD_SHARED_LIBS is OFF")
return()
endif()
cmake_parse_arguments(LIB
""
"PARENT_TARGET"
Expand Down
Loading