diff options
author | Brad King <brad.king@kitware.com> | 2020-02-11 13:19:52 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-02-11 13:20:03 (GMT) |
commit | 8e39e0c3e383e226f0d4bc6f227816cc4acf9923 (patch) | |
tree | 69b396283c9c162d17623ea4304c5a2f6c45e5fc /Modules | |
parent | 783f4720f508405f0f4e30a1ba903d2851b41053 (diff) | |
parent | 5c2a92f44f4c653b9567f03f99385ab190c5fd88 (diff) | |
download | CMake-8e39e0c3e383e226f0d4bc6f227816cc4acf9923.zip CMake-8e39e0c3e383e226f0d4bc6f227816cc4acf9923.tar.gz CMake-8e39e0c3e383e226f0d4bc6f227816cc4acf9923.tar.bz2 |
Merge topic 'swift-no-sdk-include' into release-3.17
5c2a92f44f Swift: Exclude SDK include paths
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4315
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeSwiftCompiler.cmake.in | 2 | ||||
-rw-r--r-- | Modules/CMakeTestSwiftCompiler.cmake | 5 | ||||
-rw-r--r-- | Modules/Platform/Darwin.cmake | 2 |
3 files changed, 8 insertions, 1 deletions
diff --git a/Modules/CMakeSwiftCompiler.cmake.in b/Modules/CMakeSwiftCompiler.cmake.in index 7c8d1c1..47ada38 100644 --- a/Modules/CMakeSwiftCompiler.cmake.in +++ b/Modules/CMakeSwiftCompiler.cmake.in @@ -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@") diff --git a/Modules/CMakeTestSwiftCompiler.cmake b/Modules/CMakeTestSwiftCompiler.cmake index 3e4ff95..d98dc9d 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) diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index e5a57b5..0a4d4e1 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -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() |