[PATCH] D79771: [examples] Skip building the Bye pass plugin on windows

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 13 03:44:07 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGf8972662bc3b: [examples] Skip building the Bye pass plugin on windows (authored by mstorsjo).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79771/new/

https://reviews.llvm.org/D79771

Files:
  llvm/examples/Bye/CMakeLists.txt
  llvm/test/CMakeLists.txt
  llvm/test/Feature/load_extension.ll


Index: llvm/test/Feature/load_extension.ll
===================================================================
--- llvm/test/Feature/load_extension.ll
+++ llvm/test/Feature/load_extension.ll
@@ -6,6 +6,7 @@
 ; RUN: llvm-lto2 run %t.o %loadbye %loadnewpmbye -wave-goodbye -use-new-pm -o %t -r %t.o,somefunk,plx -r %t.o,junk,plx 2>&1 | FileCheck %s
 ; RUN: llvm-lto2 run %t.o %loadbye %loadnewpmbye -opt-pipeline="goodbye" -wave-goodbye -use-new-pm -o %t -r %t.o,somefunk,plx -r %t.o,junk,plx 2>&1 | FileCheck %s
 ; REQUIRES: plugins, examples
+; UNSUPPORTED: windows
 ; CHECK: Bye
 
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
Index: llvm/test/CMakeLists.txt
===================================================================
--- llvm/test/CMakeLists.txt
+++ llvm/test/CMakeLists.txt
@@ -144,13 +144,17 @@
 
 if(LLVM_BUILD_EXAMPLES)
   list(APPEND LLVM_TEST_DEPENDS
-    Bye
     Kaleidoscope-Ch3
     Kaleidoscope-Ch4
     Kaleidoscope-Ch5
     Kaleidoscope-Ch6
     Kaleidoscope-Ch7
     )
+  if (NOT WIN32)
+    list(APPEND LLVM_TEST_DEPENDS
+      Bye
+      )
+  endif()
 endif()
 
 if(TARGET ocaml_llvm)
Index: llvm/examples/Bye/CMakeLists.txt
===================================================================
--- llvm/examples/Bye/CMakeLists.txt
+++ llvm/examples/Bye/CMakeLists.txt
@@ -2,12 +2,18 @@
   message(WARNING "Setting LLVM_BYE_LINK_INTO_TOOLS=ON only makes sense for testing purpose")
 endif()
 
-add_llvm_pass_plugin(Bye
-  Bye.cpp
-  DEPENDS
-  intrinsics_gen
-  BUILDTREE_ONLY
- )
+# The plugin expects to not link against the Support and Core 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 example on Windows.
+if (NOT WIN32)
+  add_llvm_pass_plugin(Bye
+    Bye.cpp
+    DEPENDS
+    intrinsics_gen
+    BUILDTREE_ONLY
+   )
 
-install(TARGETS ${name} RUNTIME DESTINATION examples)
-set_target_properties(${name} PROPERTIES FOLDER "Examples")
+  install(TARGETS ${name} RUNTIME DESTINATION examples)
+  set_target_properties(${name} PROPERTIES FOLDER "Examples")
+endif()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79771.263663.patch
Type: text/x-patch
Size: 2163 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200513/8106127b/attachment.bin>


More information about the llvm-commits mailing list