summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeTestSwiftCompiler.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/CMakeTestSwiftCompiler.cmake')
-rw-r--r--Modules/CMakeTestSwiftCompiler.cmake11
1 files changed, 8 insertions, 3 deletions
diff --git a/Modules/CMakeTestSwiftCompiler.cmake b/Modules/CMakeTestSwiftCompiler.cmake
index 841aee6..d98dc9d 100644
--- a/Modules/CMakeTestSwiftCompiler.cmake
+++ b/Modules/CMakeTestSwiftCompiler.cmake
@@ -20,7 +20,7 @@ unset(CMAKE_Swift_COMPILER_WORKS CACHE)
# is set and cmake stops processing commands and will not generate
# any makefiles or projects.
if(NOT CMAKE_Swift_COMPILER_WORKS)
- PrintTestCompilerStatus("Swift" "")
+ PrintTestCompilerStatus("Swift")
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/main.swift
"print(\"CMake\")\n")
try_compile(CMAKE_Swift_COMPILER_WORKS ${CMAKE_BINARY_DIR}
@@ -33,7 +33,7 @@ if(NOT CMAKE_Swift_COMPILER_WORKS)
endif()
if(NOT CMAKE_Swift_COMPILER_WORKS)
- PrintTestCompilerStatus("Swift" " -- broken")
+ PrintTestCompilerResult(CHECK_FAIL "broken")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the Swift compiler works failed with "
"the following output:\n${__CMAKE_Swift_COMPILER_OUTPUT}\n\n")
@@ -44,12 +44,17 @@ if(NOT CMAKE_Swift_COMPILER_WORKS)
"CMake will not be able to correctly generate this project.")
else()
if(Swift_TEST_WAS_RUN)
- PrintTestCompilerStatus("Swift" " -- works")
+ PrintTestCompilerResult(CHECK_PASS "works")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the Swift compiler works passed with "
"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)