@@ -84,35 +84,7 @@ endif()
84
84
# First extract the "version" used for Clang's resource directory.
85
85
string (REGEX MATCH "[0-9]+\\ .[0-9]+(\\ .[0-9]+)?" CLANG_VERSION
86
86
"${LLVM_PACKAGE_VERSION} " )
87
-
88
- # Function to find LLVM or Clang headers
89
- function (find_llvm_clang_headers suffix description out_var )
90
- file (TO_CMAKE_PATH "${SWIFT_PATH_TO_CLANG_BUILD} " PATH_TO_CLANG_BUILD )
91
-
92
- set (headers_locations
93
- "${LLVM_LIBRARY_DIR}${suffix} "
94
- "${PATH_TO_CLANG_BUILD} /${CMAKE_CFG_INTDIR} /lib${suffix} "
95
- "${PATH_TO_CLANG_BUILD} /${LLVM_BUILD_TYPE} /lib${suffix} " )
96
-
97
- set (headers_location )
98
- foreach (loc ${headers_locations} )
99
- if (EXISTS "${loc} " )
100
- set (headers_location "${loc} " )
101
- set (${out_var} "${loc} " PARENT_SCOPE )
102
- break ()
103
- endif ()
104
- endforeach ()
105
- if ("${headers_location} " STREQUAL "" )
106
- message (FATAL_ERROR "${description} headers were not found in any of the following locations: ${headers_locations} " )
107
- endif ()
108
- endfunction ()
109
-
110
- if (SWIFT_BUILT_STANDALONE )
111
- find_llvm_clang_headers ("/clang/${CLANG_VERSION} " "Clang"
112
- clang_headers_location )
113
- else () # NOT SWIFT_BUILT_STANDALONE
114
- set (clang_headers_location "${LLVM_LIBRARY_DIR} /clang/${CLANG_VERSION} " )
115
- endif ()
87
+ set (clang_headers_location "${LLVM_LIBRARY_OUTPUT_INTDIR} /clang/${CLANG_VERSION} " )
116
88
117
89
if ("${CMAKE_SYSTEM_NAME} " STREQUAL "Windows" )
118
90
set (cmake_symlink_option "copy_directory" )
@@ -152,7 +124,7 @@ swift_install_symlink_component(clang-resource-dir-symlink
152
124
# Possibly install Clang headers under Clang's resource directory in case we
153
125
# need to use a different version of the headers than the installed Clang. This
154
126
# should be used in conjunction with clang-resource-dir-symlink.
155
- file (TO_CMAKE_PATH "${SWIFT_PATH_TO_CLANG_BUILD } "
127
+ file (TO_CMAKE_PATH "${LLVM_LIBRARY_OUTPUT_INTDIR } "
156
128
_SWIFT_SHIMS_PATH_TO_CLANG_BUILD )
157
129
swift_install_in_component (clang-builtin-headers-in-clang-resource-dir
158
130
DIRECTORY "${_SWIFT_SHIMS_PATH_TO_CLANG_BUILD} /lib/clang"
0 commit comments