]> granicus.if.org Git - clang/commitdiff
[libclang] CMake: add an option to control building libclang as a static library...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Thu, 6 Jun 2013 19:51:37 +0000 (19:51 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Thu, 6 Jun 2013 19:51:37 +0000 (19:51 +0000)
This avoids building libclang twice by default.

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

tools/libclang/CMakeLists.txt

index c5a975b637607840fd03433b26595c36fbcff9d1..236ae0ed939a5598afff65ddd018c229cb13b9a2 100644 (file)
@@ -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)