forked from OSchip/llvm-project
[libclang] CMake: add an option to control building libclang as a static library (off by default)
This avoids building libclang twice by default. llvm-svn: 183437
This commit is contained in:
parent
41a7b06888
commit
f7b32a0bd0
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue