summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-05-17 15:11:50 (GMT)
committerKitware Robot <kwrobot@kitware.com>2024-05-17 15:11:59 (GMT)
commit27947ed75a6b7ecc99e5fa29f2bf50812ddabdcb (patch)
tree8d6ecb61658fb5ad1d14cc3a971aef35dc7c1531 /Modules
parent603abee7afebf26e02285ab282263b2cbc76ceea (diff)
parentc6e52ef7f2ce5a91f23e500faab64c6a632401d0 (diff)
downloadCMake-27947ed75a6b7ecc99e5fa29f2bf50812ddabdcb.zip
CMake-27947ed75a6b7ecc99e5fa29f2bf50812ddabdcb.tar.gz
CMake-27947ed75a6b7ecc99e5fa29f2bf50812ddabdcb.tar.bz2
Merge topic 'ewilde/swift-static-try-compile'
c6e52ef7f2 Swift: Support static-library try-compile type Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9520
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)