Skip to content

Commit 2b3f063

Browse files
committed
Add a CLANG_EXPORT arg to add_clang_library cmake function instead of and make OBJECT targets for it default to importing clang symbols
1 parent 2de83a0 commit 2b3f063

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

clang-tools-extra/clangd/refactor/tweaks/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ set(LLVM_LINK_COMPONENTS
1111
# To enable these tweaks in executables or shared libraries, add
1212
# $<TARGET_OBJECTS:obj.clangDaemonTweaks> to a list of sources, see
1313
# clangd/tool/CMakeLists.txt for an example.
14-
add_clang_library(clangDaemonTweaks CLANG_IMPORT OBJECT
14+
add_clang_library(clangDaemonTweaks OBJECT
1515
AddUsing.cpp
1616
AnnotateHighlightings.cpp
1717
DumpAST.cpp

clang/cmake/modules/AddClang.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ endmacro()
4747

4848
macro(add_clang_library name)
4949
cmake_parse_arguments(ARG
50-
"SHARED;STATIC;INSTALL_WITH_TOOLCHAIN;CLANG_IMPORT"
50+
"SHARED;STATIC;OBJECT;INSTALL_WITH_TOOLCHAIN;CLANG_EXPORT"
5151
""
5252
"ADDITIONAL_HEADERS"
5353
${ARGN})
@@ -115,7 +115,7 @@ macro(add_clang_library name)
115115
if(TARGET "obj.${name}")
116116
target_compile_definitions("obj.${name}" PUBLIC CLANG_BUILD_STATIC)
117117
endif()
118-
elseif(TARGET "obj.${name}" AND NOT ARG_SHARED AND NOT ARG_STATIC AND NOT ARG_CLANG_IMPORT)
118+
elseif(TARGET "obj.${name}" AND (ARG_CLANG_EXPORT OR NOT (ARG_SHARED OR ARG_STATIC OR ARG_OBJECT)))
119119
# Clang component libraries linked to clang-cpp are declared without SHARED or STATIC
120120
target_compile_definitions("obj.${name}" PUBLIC CLANG_EXPORTS)
121121
endif()

0 commit comments

Comments
 (0)