r352253 - Attempt to fix build on Windows with LLVM_ENABLE_PIC=OFF

Nico Weber via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 25 15:37:58 PST 2019


Author: nico
Date: Fri Jan 25 15:37:57 2019
New Revision: 352253

URL: http://llvm.org/viewvc/llvm-project?rev=352253&view=rev
Log:
Attempt to fix build on Windows with LLVM_ENABLE_PIC=OFF

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 there. This is also somewhat symmetric with the existing
ENABLE_STATIC a few lines down.

Differential Revision: https://reviews.llvm.org/D57258

Modified:
    cfe/trunk/tools/libclang/CMakeLists.txt

Modified: cfe/trunk/tools/libclang/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CMakeLists.txt?rev=352253&r1=352252&r2=352253&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CMakeLists.txt (original)
+++ cfe/trunk/tools/libclang/CMakeLists.txt Fri Jan 25 15:37:57 2019
@@ -74,7 +74,7 @@ if(MSVC)
   set(LLVM_EXPORTED_SYMBOL_FILE)
 endif()
 
-if( LLVM_ENABLE_PIC )
+if(LLVM_ENABLE_PIC OR WIN32)
   set(ENABLE_SHARED SHARED)
 endif()
 




More information about the cfe-commits mailing list