[CMake] add_clang_library(MODULE): Create a phony target when llvm_add_library(MODULE) gave up.

llvm-svn: 201319
This commit is contained in:
NAKAMURA Takumi 2014-02-13 11:24:45 +00:00
parent e72e2e9088
commit 8e57597830
1 changed files with 11 additions and 6 deletions

View File

@ -311,13 +311,18 @@ macro(add_clang_library name)
endif()
llvm_add_library(${name} ${ARG_UNPARSED_ARGUMENTS} ${srcs})
target_link_libraries( ${name} ${LLVM_COMMON_LIBS} )
if(TARGET ${name})
target_link_libraries( ${name} ${LLVM_COMMON_LIBS} )
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "libclang")
install(TARGETS ${name}
LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
RUNTIME DESTINATION bin)
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "libclang")
install(TARGETS ${name}
LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
RUNTIME DESTINATION bin)
endif()
else()
# Add empty "phony" target
add_custom_target(${name})
endif()
set_target_properties(${name} PROPERTIES FOLDER "Clang libraries")