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
This commit is contained in:
Yauheni Khnykin
2020-02-04 20:47:30 +01:00
committed by Brad King
parent 155540d89e
commit 5c2a92f44f
7 changed files with 89 additions and 1 deletions
+5
View File
@@ -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)