[PATCH] D57258: Attempt to fix build on Windows with LLVM_ENABLE_PIC=OFF

Nico Weber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 25 13:12:13 PST 2019


thakis created this revision.
thakis added a reviewer: rnk.
Herald added a subscriber: mgorny.

libclang can be built in shared or static mode. On Windows, with LLVM_ENABLE_PIC=OFF, it was built in neither mode, leading to clients of libclang (c-index-test, c-arcmt-test) failing to link with it set.

Since PIC isn't really a thing on Windows, build libclang in shared mode when LLVM_ENABLE_PIC=OFF on Windows. This is also somewhat symmetric with the existing ENABLE_STATIC a few lines down.


https://reviews.llvm.org/D57258

Files:
  tools/libclang/CMakeLists.txt


Index: tools/libclang/CMakeLists.txt
===================================================================
--- tools/libclang/CMakeLists.txt
+++ tools/libclang/CMakeLists.txt
@@ -74,7 +74,7 @@
   set(LLVM_EXPORTED_SYMBOL_FILE)
 endif()
 
-if( LLVM_ENABLE_PIC )
+if(LLVM_ENABLE_PIC OR WIN32)
   set(ENABLE_SHARED SHARED)
 endif()
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57258.183606.patch
Type: text/x-patch
Size: 329 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190125/a3403679/attachment.bin>


More information about the cfe-commits mailing list