]> granicus.if.org Git - clang/commitdiff
Attempt to fix build on Windows with LLVM_ENABLE_PIC=OFF
authorNico Weber <nicolasweber@gmx.de>
Fri, 25 Jan 2019 23:37:57 +0000 (23:37 +0000)
committerNico Weber <nicolasweber@gmx.de>
Fri, 25 Jan 2019 23:37:57 +0000 (23:37 +0000)
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@352253 91177308-0d34-0410-b5e6-96231b3b80d8

tools/libclang/CMakeLists.txt

index 32333b011ad1315e199f3dc315a635f5702e4338..5a26d2c112b9993560657568ca246e1277d99683 100644 (file)
@@ -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()