Skip to content

Commit a6ea018

Browse files
carlo-braminimstorsjo
authored andcommitted
[llvm] CYGWIN: Fix build of some plugins/library/unittests
CYGWIN uses the same format of WIN32 for shared libraries. As the comment says: "a shared library can't have undefined references", in this case CYGWIN must be handled like WIN32 by CMakeLists.txt, otherwise you will get several errors when linking because some symbols are undefined. Attached patch fixes this issue and allows to complete the build process for those targets. Differential Revision: https://reviews.llvm.org/D154794
1 parent a1b7db3 commit a6ea018

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

llvm/examples/Bye/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ endif()
66
# but expects them to exist in the process loading the plugin. This doesn't
77
# work with DLLs on Windows (where a shared library can't have undefined
88
# references), so just skip this example on Windows.
9-
if (NOT WIN32)
9+
if (NOT WIN32 AND NOT CYGWIN)
1010
add_llvm_pass_plugin(Bye
1111
Bye.cpp
1212
DEPENDS

llvm/examples/IRTransforms/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ endif()
66
# but expects them to exist in the process loading the plugin. This doesn't
77
# work with DLLs on Windows (where a shared library can't have undefined
88
# references), so just skip this example on Windows.
9-
if (NOT WIN32)
9+
if (NOT WIN32 AND NOT CYGWIN)
1010
add_llvm_pass_plugin(ExampleIRTransforms
1111
SimplifyCFG.cpp
1212
DEPENDS

llvm/unittests/Analysis/InlineAdvisorPlugin/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# libraries, but expects them to exist in the process loading the plugin. This
33
# doesn't work with DLLs on Windows (where a shared library can't have undefined
44
# references), so just skip this testcase on Windows.
5-
if (NOT WIN32)
5+
if (NOT WIN32 AND NOT CYGWIN)
66
unset(LLVM_LINK_COMPONENTS)
77
add_llvm_library(InlineAdvisorPlugin MODULE BUILDTREE_ONLY
88
InlineAdvisorPlugin.cpp

llvm/unittests/Analysis/InlineOrderPlugin/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# libraries, but expects them to exist in the process loading the plugin. This
33
# doesn't work with DLLs on Windows (where a shared library can't have undefined
44
# references), so just skip this testcase on Windows.
5-
if (NOT WIN32)
5+
if (NOT WIN32 AND NOT CYGWIN)
66
unset(LLVM_LINK_COMPONENTS)
77
add_llvm_library(InlineOrderPlugin MODULE BUILDTREE_ONLY
88
InlineOrderPlugin.cpp

llvm/unittests/Passes/Plugins/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# but expects them to exist in the process loading the plugin. This doesn't
33
# work with DLLs on Windows (where a shared library can't have undefined
44
# references), so just skip this testcase on Windows.
5-
if (NOT WIN32)
5+
if (NOT WIN32 AND NOT CYGWIN)
66
set(LLVM_LINK_COMPONENTS Support Passes Core AsmParser)
77
add_llvm_unittest(PluginsTests
88
PluginsTest.cpp

0 commit comments

Comments
 (0)