summaryrefslogtreecommitdiffstats
path: root/Tests/SwiftMix/SwiftMain.swift
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-07-06 20:15:49 (GMT)
committerBrad King <brad.king@kitware.com>2015-07-06 20:15:49 (GMT)
commitbf11253163b54f7c18b001cb00973a6341ee859b (patch)
treeadf50cd777722e5c08168025889c08a2e7ce68da /Tests/SwiftMix/SwiftMain.swift
parent8fbd9584af44100bbddd0f4031b57c5bc2530837 (diff)
downloadCMake-bf11253163b54f7c18b001cb00973a6341ee859b.zip
CMake-bf11253163b54f7c18b001cb00973a6341ee859b.tar.gz
CMake-bf11253163b54f7c18b001cb00973a6341ee859b.tar.bz2
Add rudimentary support for the Apple Swift language with Xcode
Allow the `Swift` language to be enabled with the Xcode generator for Xcode >= 6.1. Reject it on other generators and with older Xcode versions. Since Apple is the only vendor implementing the language right now, the compiler id can be just `Apple`.
Diffstat (limited to 'Tests/SwiftMix/SwiftMain.swift')
-rw-r--r--Tests/SwiftMix/SwiftMain.swift10
1 files changed, 10 insertions, 0 deletions
diff --git a/Tests/SwiftMix/SwiftMain.swift b/Tests/SwiftMix/SwiftMain.swift
new file mode 100644
index 0000000..9af9883
--- /dev/null
+++ b/Tests/SwiftMix/SwiftMain.swift
@@ -0,0 +1,10 @@
+@objc class SwiftMainClass {
+ class func SwiftMain(argc:Int, argv:UnsafePointer<UnsafePointer<CChar>>) -> Int32 {
+ println("argc: \(argc)")
+ for (var i = 0; i < argc; ++i) {
+ var argi = String.fromCString(argv[i])
+ println("arg[\(i)]: \(argi)");
+ }
+ return 0;
+ }
+}