summaryrefslogtreecommitdiff
path: root/Modules/CMakeTestSwiftCompiler.cmake
diff options
context:
space:
mode:
authorYauheni Khnykin <yauheni.khnykin@here.com>2020-02-04 20:47:30 +0100
committerBrad King <brad.king@kitware.com>2020-02-10 10:32:37 -0500
commit5c2a92f44f4c653b9567f03f99385ab190c5fd88 (patch)
tree66f2a02903f2a16c34bc3ca32de405de5b2c501b /Modules/CMakeTestSwiftCompiler.cmake
parent155540d89eb5ac00fd8ba03a9580de2382af6386 (diff)
downloadcmake-5c2a92f44f4c653b9567f03f99385ab190c5fd88.tar.gz
Swift: Exclude SDK include paths
Populate `CMAKE_Swift_IMPLICIT_INCLUDE_DIRECTORIES` with the macOS SDK's include directory so that we filter such implicit directories out of Swift targets. Fixes: #19845
Diffstat (limited to 'Modules/CMakeTestSwiftCompiler.cmake')
-rw-r--r--Modules/CMakeTestSwiftCompiler.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/CMakeTestSwiftCompiler.cmake b/Modules/CMakeTestSwiftCompiler.cmake
index 3e4ff95e43..d98dc9dfa3 100644
--- a/Modules/CMakeTestSwiftCompiler.cmake
+++ b/Modules/CMakeTestSwiftCompiler.cmake
@@ -50,6 +50,11 @@ else()
"the following output:\n${__CMAKE_Swift_COMPILER_OUTPUT}\n\n")
endif()
+ # Unlike C and CXX we do not yet detect any information about the Swift ABI.
+ # However, one of the steps done for C and CXX as part of that detection is
+ # to initialize the implicit include directories. That is relevant here.
+ set(CMAKE_Swift_IMPLICIT_INCLUDE_DIRECTORIES "${_CMAKE_Swift_IMPLICIT_INCLUDE_DIRECTORIES_INIT}")
+
# Re-configure to save learned information.
configure_file(${CMAKE_ROOT}/Modules/CMakeSwiftCompiler.cmake.in
${CMAKE_PLATFORM_INFO_DIR}/CMakeSwiftCompiler.cmake @ONLY)