[PATCH] D155796: [polly] CYGWIN: fix build error about PIC code.

Carlo Bramini via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 20 00:57:44 PDT 2023


carlo-bramini created this revision.
carlo-bramini added a reviewer: grosser.
Herald added a reviewer: bollu.
Herald added a project: All.
carlo-bramini requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

CYGWIN shares the same behaviour of traditional WIN32 executables about PIC code.
For this reason, CMakeLists.txt must handle this platform in the same way, to avoid the build errors that happened also on WIN32.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D155796

Files:
  polly/cmake/CMakeLists.txt
  polly/lib/CMakeLists.txt


Index: polly/lib/CMakeLists.txt
===================================================================
--- polly/lib/CMakeLists.txt
+++ polly/lib/CMakeLists.txt
@@ -115,7 +115,7 @@
 
 # Create a loadable module Polly.so that can be loaded using
 # LLVM's/clang's "-load" option.
-if (WIN32 OR NOT LLVM_ENABLE_PIC)
+if (WIN32 OR CYGWIN OR NOT LLVM_ENABLE_PIC)
   # Add dummy target, either because loadable modules are not supported
   # as on Windows or because PIC code has been disabled
   add_custom_target(LLVMPolly)
Index: polly/cmake/CMakeLists.txt
===================================================================
--- polly/cmake/CMakeLists.txt
+++ polly/cmake/CMakeLists.txt
@@ -23,7 +23,7 @@
 endif()
 
 set(POLLY_CONFIG_EXPORTED_TARGETS Polly ${ISL_TARGET})
-if (NOT WIN32 AND LLVM_ENABLE_PIC)
+if (NOT (WIN32 OR CYGWIN) AND LLVM_ENABLE_PIC)
   # LLVMPolly is a dummy target on Win or if PIC code is disabled.
   list(APPEND POLLY_CONFIG_EXPORTED_TARGETS LLVMPolly)
 endif()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155796.542342.patch
Type: text/x-patch
Size: 984 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230720/abe584f6/attachment.bin>


More information about the llvm-commits mailing list