summaryrefslogtreecommitdiff
path: root/Modules/CMakeTestSwiftCompiler.cmake
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:21:01 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:21:01 +0900
commitded4fa4e65fc84ea8272668c82cccf1e724419a6 (patch)
tree1ad49f49e54e8f59095e168dabf0baf9c2011de4 /Modules/CMakeTestSwiftCompiler.cmake
parent3257609f41111c6192158f0bf97d382406926974 (diff)
downloadcmake-ded4fa4e65fc84ea8272668c82cccf1e724419a6.tar.gz
cmake-ded4fa4e65fc84ea8272668c82cccf1e724419a6.tar.bz2
cmake-ded4fa4e65fc84ea8272668c82cccf1e724419a6.zip
Imported Upstream version 3.21.1upstream/3.21.1
Diffstat (limited to 'Modules/CMakeTestSwiftCompiler.cmake')
-rw-r--r--Modules/CMakeTestSwiftCompiler.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/CMakeTestSwiftCompiler.cmake b/Modules/CMakeTestSwiftCompiler.cmake
index d98dc9dfa..2f2546f86 100644
--- a/Modules/CMakeTestSwiftCompiler.cmake
+++ b/Modules/CMakeTestSwiftCompiler.cmake
@@ -23,6 +23,9 @@ if(NOT CMAKE_Swift_COMPILER_WORKS)
PrintTestCompilerStatus("Swift")
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/main.swift
"print(\"CMake\")\n")
+ # Clear result from normal variable.
+ unset(CMAKE_Swift_COMPILER_WORKS)
+ # Puts test result in cache variable.
try_compile(CMAKE_Swift_COMPILER_WORKS ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/main.swift
OUTPUT_VARIABLE __CMAKE_Swift_COMPILER_OUTPUT)