r183437 - [libclang] CMake: add an option to control building libclang as a static library (off by default)

Argyrios Kyrtzidis akyrtzi at gmail.com
Thu Jun 6 12:51:37 PDT 2013


Author: akirtzidis
Date: Thu Jun  6 14:51:37 2013
New Revision: 183437

URL: http://llvm.org/viewvc/llvm-project?rev=183437&view=rev
Log:
[libclang] CMake: add an option to control building libclang as a static library (off by default)

This avoids building libclang twice by default.

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=183437&r1=183436&r2=183437&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CMakeLists.txt (original)
+++ cfe/trunk/tools/libclang/CMakeLists.txt Thu Jun  6 14:51:37 2013
@@ -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)





More information about the cfe-commits mailing list