From: Nico Weber Date: Fri, 25 Jan 2019 23:37:57 +0000 (+0000) Subject: Attempt to fix build on Windows with LLVM_ENABLE_PIC=OFF X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8a558a52a96fc5411834e6e015219513a9986bdc;p=clang 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@352253 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt index 32333b011a..5a26d2c112 100644 --- a/tools/libclang/CMakeLists.txt +++ b/tools/libclang/CMakeLists.txt @@ -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()