Skip to content

[cmake] lldb: Build libraries with -DCLANG_BUILD_STATIC on Windows #11127

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: stable/21.x
Choose a base branch
from
Open
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
9 changes: 9 additions & 0 deletions lldb/cmake/modules/AddLLDB.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ function(add_lldb_library name)
${pass_NO_INSTALL_RPATH}
)

if(MSVC)
# LLDB libraries are always linked with Clang libraries statically, so turn
# off Clang visibility macros for both the library and its consumers.
target_compile_definitions(${name} PUBLIC CLANG_BUILD_STATIC)
if(TARGET "obj.${name}")
target_compile_definitions("obj.${name}" PUBLIC CLANG_BUILD_STATIC)
endif()
endif()

if(CLANG_LINK_CLANG_DYLIB)
target_link_libraries(${name} PRIVATE clang-cpp)
else()
Expand Down