From: Argyrios Kyrtzidis Date: Thu, 6 Jun 2013 19:51:37 +0000 (+0000) Subject: [libclang] CMake: add an option to control building libclang as a static library... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c09f2a865c912ee5d81bee7586c77a73ad302fd7;p=clang [libclang] CMake: add an option to control building libclang as a static library (off by default) This avoids building libclang twice by default. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183437 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt index c5a975b637..236ae0ed93 100644 --- a/tools/libclang/CMakeLists.txt +++ b/tools/libclang/CMakeLists.txt @@ -105,7 +105,10 @@ else() set(LIBCLANG_STATIC_TARGET_NAME libclang) endif() -if( NOT BUILD_SHARED_LIBS AND NOT WIN32 ) +option(LIBCLANG_BUILD_STATIC + "Build libclang as a static library (in addition to a shared one)" OFF) + +if( (NOT LLVM_ENABLE_PIC OR LIBCLANG_BUILD_STATIC) AND NOT WIN32 ) add_clang_library(${LIBCLANG_STATIC_TARGET_NAME} STATIC ${SOURCES}) target_link_libraries(${LIBCLANG_STATIC_TARGET_NAME} ${LIBRARIES}) add_dependencies(${LIBCLANG_STATIC_TARGET_NAME} ${GENERATED_HEADERS} clang-headers)