[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,6 +311,7 @@ macro(add_clang_library name)
endif()
llvm_add_library(${name} ${ARG_UNPARSED_ARGUMENTS} ${srcs})
if(TARGET ${name})
target_link_libraries( ${name} ${LLVM_COMMON_LIBS} )
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "libclang")
@ -319,6 +320,10 @@ macro(add_clang_library name)
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")
endmacro(add_clang_library)