[cmake] Add clang-headers as a dependency of libclang and if we have to copy them
for the IDE case, also create a symlink inside the libclang.dylib directory.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178372 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt
index ebc92e7..5e727a7 100644
--- a/lib/Headers/CMakeLists.txt
+++ b/lib/Headers/CMakeLists.txt
@@ -95,6 +95,13 @@
add_custom_target(clang-headers ALL DEPENDS ${out_files})
set_target_properties(clang-headers PROPERTIES FOLDER "Misc")
+if (other_output_dir)
+ if(UNIX)
+ add_custom_command(TARGET clang-headers POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E create_symlink "${LLVM_BINARY_DIR}/bin/lib/clang" "${LLVM_BINARY_DIR}/lib/${CMAKE_CFG_INTDIR}/clang")
+ endif()
+endif ()
+
install(FILES ${files} ${output_dir}/arm_neon.h
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt
index dd4eccf..c5a975b 100644
--- a/tools/libclang/CMakeLists.txt
+++ b/tools/libclang/CMakeLists.txt
@@ -74,7 +74,7 @@
set(SHARED_LIBRARY TRUE)
add_clang_library(libclang ${SOURCES})
target_link_libraries(libclang ${LIBRARIES})
- add_dependencies(libclang ${GENERATED_HEADERS})
+ add_dependencies(libclang ${GENERATED_HEADERS} clang-headers)
if(WIN32)
set_target_properties(libclang
@@ -108,7 +108,7 @@
if( NOT BUILD_SHARED_LIBS 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})
+ add_dependencies(${LIBCLANG_STATIC_TARGET_NAME} ${GENERATED_HEADERS} clang-headers)
set_target_properties(${LIBCLANG_STATIC_TARGET_NAME}
PROPERTIES