summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeTestSwiftCompiler.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/CMakeTestSwiftCompiler.cmake b/Modules/CMakeTestSwiftCompiler.cmake
index c7df912..d89e606 100644
--- a/Modules/CMakeTestSwiftCompiler.cmake
+++ b/Modules/CMakeTestSwiftCompiler.cmake
@@ -24,7 +24,10 @@ if(NOT CMAKE_Swift_COMPILER_WORKS)
# Clear result from normal variable.
unset(CMAKE_Swift_COMPILER_WORKS)
# Puts test result in cache variable.
- set(__CMAKE_Swift_TEST_SOURCE "print(\"CMake\")\n")
+ string(CONCAT __CMAKE_Swift_TEST_SOURCE
+ "public struct CMakeStruct {"
+ " let x: Int"
+ "}")
try_compile(CMAKE_Swift_COMPILER_WORKS
SOURCE_FROM_VAR main.swift __CMAKE_Swift_TEST_SOURCE
OUTPUT_VARIABLE __CMAKE_Swift_COMPILER_OUTPUT)