-
Notifications
You must be signed in to change notification settings - Fork 344
[stable/21.x][cmake] lldb: Turn of clang visibility macros if not CLANG_LINK_CLANG_DYLIB
#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
base: stable/21.x
Are you sure you want to change the base?
Conversation
if(MSVC AND NOT CLANG_LINK_CLANG_DYLIB) | ||
# Make sure all consumers also turn off visibility macros so the're not | ||
# trying to dllimport symbols. | ||
target_compile_definitions(${name} PUBLIC CLANG_BUILD_STATIC) | ||
if(TARGET "obj.${name}") | ||
target_compile_definitions("obj.${name}" PUBLIC CLANG_BUILD_STATIC) | ||
endif() | ||
elseif(NOT PARAM_SHARED AND NOT PARAM_STATIC) | ||
# lldb component libraries linked in to clang-cpp are declared without | ||
# SHARED or STATIC. | ||
target_compile_definitions("obj.${name}" PUBLIC CLANG_EXPORTS) | ||
endif() | ||
|
||
if(CLANG_LINK_CLANG_DYLIB) | ||
target_link_libraries(${name} PRIVATE clang-cpp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This
if(MSVC AND NOT CLANG_LINK_CLANG_DYLIB)
...
elseif(NOT PARAM_SHARED AND NOT PARAM_STATIC)
target_compile_definitions("obj.${name}" PUBLIC CLANG_EXPORTS)
endif()
...
if(CLANG_LINK_CLANG_DYLIB)
target_link_libraries(${name} PRIVATE clang-cpp)
flow is odd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @fsfod
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idk why i did it that way, but do the LLDB libraries even need there API exported from the clang shared library anyway? I should also mention @andrurogerz is continuing most of the work on this now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is something off with the way the CLANG_ABI
annotation definitions are gated right now in LLVM main. I found yesterday that after annotating a bunch of the clang symbols the project doesn't build on Windows even when you don't enable DLL builds. I have not looked into the issue.
This change mirrors
https://github.com/llvm/llvm-project/pull/108276/files#diff-4dd645a8b76bb3886a505258a8c2e598aeddea770e7b0a2b51689124a5ea6e9a.