Merge topic 'swift-no-sdk-include'

5c2a92f44f Swift: Exclude SDK include paths

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4315
This commit is contained in:
Brad King
2020-02-11 13:19:52 +00:00
committed by Kitware Robot
7 changed files with 89 additions and 1 deletions
+2
View File
@@ -12,3 +12,5 @@ set(CMAKE_Swift_COMPILER_ENV_VAR "SWIFTC")
set(CMAKE_Swift_COMPILER_ID_RUN 1)
set(CMAKE_Swift_SOURCE_FILE_EXTENSIONS swift)
set(CMAKE_Swift_IMPLICIT_INCLUDE_DIRECTORIES "@CMAKE_Swift_IMPLICIT_INCLUDE_DIRECTORIES@")
+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)
+1 -1
View File
@@ -210,7 +210,7 @@ unset(_apps_paths)
include(Platform/UnixPaths)
if(_CMAKE_OSX_SYSROOT_PATH AND EXISTS ${_CMAKE_OSX_SYSROOT_PATH}/usr/include)
list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${_CMAKE_OSX_SYSROOT_PATH}/usr)
foreach(lang C CXX OBJC OBJCXX)
foreach(lang C CXX OBJC OBJCXX Swift)
list(APPEND _CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES_INIT ${_CMAKE_OSX_SYSROOT_PATH}/usr/include)
endforeach()
endif()