summaryrefslogtreecommitdiffstats
path: root/Tests/SwiftMix/SwiftMain.swift
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-10-25 15:56:34 (GMT)
committerBrad King <brad.king@kitware.com>2022-10-25 18:09:28 (GMT)
commitc0dd3dd2c13d8b7621bc86b6ea93e9188ab5dba7 (patch)
treef2633c270b2ff19368dad218097b3cb00d923b18 /Tests/SwiftMix/SwiftMain.swift
parent19f49a7514797bc27b37482701a8d81c2ea57854 (diff)
downloadCMake-c0dd3dd2c13d8b7621bc86b6ea93e9188ab5dba7.zip
CMake-c0dd3dd2c13d8b7621bc86b6ea93e9188ab5dba7.tar.gz
CMake-c0dd3dd2c13d8b7621bc86b6ea93e9188ab5dba7.tar.bz2
Xcode: Evaluate Swift compile definitions separately
Xcode has a separate setting for Swift compile definitions, so we can compute a dedicated value for it. Therefore we can: * Support the COMPILE_LANGUAGE generator expression for Swift-specific filters. * Avoid passing the `=value` part of definitions, which Swift does not support. This revises commit 5cb625eb2f (Xcode: Pass compile definitions to Swift, 2022-06-19, v3.25.0-rc1~493^2) and reverts commit 12c6fec6b4 (Xcode: Drop CMAKE_INTDIR= definition in Swift targets, 2022-09-30, v3.25.0-rc1~60^2~2), as the latter is no longer needed. Fixes: #24086
Diffstat (limited to 'Tests/SwiftMix/SwiftMain.swift')
-rw-r--r--Tests/SwiftMix/SwiftMain.swift20
1 files changed, 20 insertions, 0 deletions
diff --git a/Tests/SwiftMix/SwiftMain.swift b/Tests/SwiftMix/SwiftMain.swift
index d9c8cd7..238059d 100644
--- a/Tests/SwiftMix/SwiftMain.swift
+++ b/Tests/SwiftMix/SwiftMain.swift
@@ -3,6 +3,26 @@ import Foundation
@objc class SwiftMainClass : NSObject {
@objc class func SwiftMain() -> Int32 {
dump("Hello World!");
+#if FOO
+ dump("FOO defined");
+#else
+ fatalError("FOO not defined");
+#endif
+#if BAR
+ dump("BAR defined");
+#else
+ fatalError("BAR not defined");
+#endif
+#if CCOND
+ fatalError("CCOND defined");
+#else
+ dump("CCOND not defined");
+#endif
+#if SWIFTCOND
+ dump("SWIFTCOND defined");
+#else
+ fatalError("SWIFTCOND not defined");
+#endif
return 0;
}
}