[CMake] Fix install of Swift's copy of Clang headers.

This is a speculative fix for rdar://problem/23570075, as fallout from
e6bdcbcc. I fixed the build directory, but not the install components.
This commit is contained in:
Jordan Rose
2015-11-17 08:51:50 -08:00
parent 0fc6dc8e3b
commit ebcadcfc38

View File

@@ -54,11 +54,7 @@ foreach(loc ${clang_headers_locations})
endif() endif()
endforeach() endforeach()
if("${clang_headers_location}" STREQUAL "") if("${clang_headers_location}" STREQUAL "")
if(SWIFT_BUILT_STANDALONE) message(FATAL_ERROR "Clang headers were not found")
message(FATAL_ERROR "Clang headers were not found")
else()
set(clang_headers_location "${LLVM_LIBRARY_DIR}/clang")
endif()
endif() endif()
add_custom_command_target(unused_var add_custom_command_target(unused_var
@@ -69,11 +65,11 @@ add_custom_command_target(unused_var
"${clang_headers_location}" "${clang_headers_location}"
"${SWIFTLIB_DIR}/clang" "${SWIFTLIB_DIR}/clang"
# Create a broken symlink that points to '../clang'. It is not used when # Create a broken symlink that points to '../clang/$VERSION'. It is not
# running Swift tools from the build tree directly, but we will install it # used when running Swift tools from the build tree directly, but we will
# in such a way that it points to Clang installation. If the link can be # install it in such a way that it points to Clang installation. If the
# resolved, CMake would try to follow it when installing the project under # link can be resolved, CMake would try to follow it when installing the
# certain conditions. # project under certain conditions.
COMMAND COMMAND
"${CMAKE_COMMAND}" "-E" "make_directory" "${SWIFTLIB_DIR}/install-tmp/install-tmp" "${CMAKE_COMMAND}" "-E" "make_directory" "${SWIFTLIB_DIR}/install-tmp/install-tmp"
COMMAND COMMAND
@@ -81,7 +77,7 @@ add_custom_command_target(unused_var
"${SWIFTLIB_DIR}/install-tmp/install-tmp/clang" "${SWIFTLIB_DIR}/install-tmp/install-tmp/clang"
COMMAND COMMAND
"${CMAKE_COMMAND}" "-E" "create_symlink" "${CMAKE_COMMAND}" "-E" "create_symlink"
"../clang" "../clang/${CLANG_VERSION}"
"${SWIFTLIB_DIR}/install-tmp/install-tmp/clang" "${SWIFTLIB_DIR}/install-tmp/install-tmp/clang"
CUSTOM_TARGET_NAME "symlink_clang_headers" CUSTOM_TARGET_NAME "symlink_clang_headers"
OUTPUT "${SWIFTLIB_DIR}/clang" "${SWIFTLIB_DIR}/install-tmp/install-tmp/clang" OUTPUT "${SWIFTLIB_DIR}/clang" "${SWIFTLIB_DIR}/install-tmp/install-tmp/clang"
@@ -95,7 +91,7 @@ swift_install_in_component(compiler
# Install Clang headers under the Swift library so that an installed Swift's # Install Clang headers under the Swift library so that an installed Swift's
# module importer can find the compiler headers corresponding to its Clang. # module importer can find the compiler headers corresponding to its Clang.
swift_install_in_component(clang-builtin-headers swift_install_in_component(clang-builtin-headers
DIRECTORY "${SWIFT_PATH_TO_CLANG_BUILD}/lib/clang" DIRECTORY "${clang_headers_location}"
DESTINATION "lib/swift" DESTINATION "lib/swift"
PATTERN "*.h") PATTERN "*.h")