File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,15 @@ 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
- set (clang_headers_location "${LLVM_LIBRARY_OUTPUT_INTDIR} /clang/${CLANG_VERSION} " )
87
+ if (NOT SWIFT_INCLUDE_TOOLS AND SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER )
88
+ execute_process (COMMAND ${CMAKE_C_COMPILER} -print-resource-dir
89
+ OUTPUT_VARIABLE clang_headers_location
90
+ OUTPUT_STRIP_TRAILING_WHITESPACE
91
+ ERROR_QUIET )
92
+ message (STATUS "using clang resource directory: ${clang_headers_location} " )
93
+ else ()
94
+ set (clang_headers_location "${LLVM_LIBRARY_OUTPUT_INTDIR} /clang/${CLANG_VERSION} " )
95
+ endif ()
88
96
89
97
if ("${CMAKE_SYSTEM_NAME} " STREQUAL "Windows" )
90
98
set (cmake_symlink_option "copy_directory" )
You can’t perform that action at this time.
0 commit comments