Skip to content

Commit 609ef94

Browse files
committed
[CMake] Fix building with -DBUILD_SHARED_LIBS=ON on mingw
Set the right target name in clang/examples/Attribute. Add a missing dependency in the TableGen GlobalISel sublibrary. Skip building the Bye pass plugin example on windows; plugins that should have undefined symbols that are found in the host process aren't supported on windows - this matches what was done for a unit test in bc8e442.
1 parent d12d05a commit 609ef94

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

clang/examples/Attribute/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
add_llvm_library(Attribute MODULE Attribute.cpp PLUGIN_TOOL clang)
22

33
if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN))
4-
target_link_libraries(AnnotateFunctions ${cmake_2_8_12_PRIVATE}
4+
target_link_libraries(Attribute ${cmake_2_8_12_PRIVATE}
55
clangAST
66
clangBasic
77
clangFrontend

llvm/examples/Bye/CMakeLists.txt

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@ if(LLVM_BYE_LINK_INTO_TOOLS)
22
message(WARNING "Setting LLVM_BYE_LINK_INTO_TOOLS=ON only makes sense for testing purpose")
33
endif()
44

5-
add_llvm_pass_plugin(Bye
6-
Bye.cpp
7-
DEPENDS
8-
intrinsics_gen
9-
BUILDTREE_ONLY
10-
)
5+
# The plugin expects to not link against the Support and Core libraries,
6+
# but expects them to exist in the process loading the plugin. This doesn't
7+
# work with DLLs on Windows (where a shared library can't have undefined
8+
# references), so just skip this testcase on Windows.
9+
if (NOT WIN32)
10+
add_llvm_pass_plugin(Bye
11+
Bye.cpp
12+
DEPENDS
13+
intrinsics_gen
14+
BUILDTREE_ONLY
15+
)
1116

12-
install(TARGETS ${name} RUNTIME DESTINATION examples)
13-
set_target_properties(${name} PROPERTIES FOLDER "Examples")
17+
install(TARGETS ${name} RUNTIME DESTINATION examples)
18+
set_target_properties(${name} PROPERTIES FOLDER "Examples")
19+
endif()

llvm/utils/TableGen/GlobalISel/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
set(LLVM_LINK_COMPONENTS
22
Support
3+
TableGen
34
)
45

56
llvm_add_library(LLVMTableGenGlobalISel STATIC DISABLE_LLVM_LINK_LLVM_DYLIB

0 commit comments

Comments
 (0)