Commit a6ea0185 authored by Carlo Bramini's avatar Carlo Bramini Committed by Martin Storsjö
Browse files

[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
parent a1b7db3e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ endif()
# but expects them to exist in the process loading the plugin. This doesn't
# work with DLLs on Windows (where a shared library can't have undefined
# references), so just skip this example on Windows.
if (NOT WIN32)
if (NOT WIN32 AND NOT CYGWIN)
  add_llvm_pass_plugin(Bye
    Bye.cpp
    DEPENDS
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ endif()
# but expects them to exist in the process loading the plugin. This doesn't
# work with DLLs on Windows (where a shared library can't have undefined
# references), so just skip this example on Windows.
if (NOT WIN32)
if (NOT WIN32 AND NOT CYGWIN)
  add_llvm_pass_plugin(ExampleIRTransforms
    SimplifyCFG.cpp
    DEPENDS
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
# libraries, but expects them to exist in the process loading the plugin. This 
# doesn't work with DLLs on Windows (where a shared library can't have undefined
# references), so just skip this testcase on Windows.
if (NOT WIN32)
if (NOT WIN32 AND NOT CYGWIN)
  unset(LLVM_LINK_COMPONENTS)
  add_llvm_library(InlineAdvisorPlugin MODULE BUILDTREE_ONLY
    InlineAdvisorPlugin.cpp
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
# libraries, but expects them to exist in the process loading the plugin. This 
# doesn't work with DLLs on Windows (where a shared library can't have undefined
# references), so just skip this testcase on Windows.
if (NOT WIN32)
if (NOT WIN32 AND NOT CYGWIN)
  unset(LLVM_LINK_COMPONENTS)
  add_llvm_library(InlineOrderPlugin MODULE BUILDTREE_ONLY
    InlineOrderPlugin.cpp
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
# but expects them to exist in the process loading the plugin. This doesn't
# work with DLLs on Windows (where a shared library can't have undefined
# references), so just skip this testcase on Windows.
if (NOT WIN32)
if (NOT WIN32 AND NOT CYGWIN)
  set(LLVM_LINK_COMPONENTS Support Passes Core AsmParser)
  add_llvm_unittest(PluginsTests
    PluginsTest.cpp