Swift compiler for Cygwin
Pre-releaseSystem Requirement
- This archive is an EXPERIMENTAL build on Cygwin 64bit.
- To compiling Swift source, you should install Cygwin 2.5.2 64bit.
- Addition to the default Cygwin packages, you should select some packages.
- Devel folder: clang (3.7.1-1) - C/C++ compiler frontend based on LLVM
- Libs folder: libiconv-devel (1.14-3) - Unicode iconv() implementation
- Libs folder: libicu-devel (57.1-1) - IBM Internationalization Components for Unicode
Install
Download and extract swift-cygwin-20160913-bin.tar.gz.
Add the Swift toolchain to your path.
export PATH=$PATH:(your swift directory)/bin
Run
You can try to run the Package Manger.
(swift test
does not work due to some bugs.)
ex)
$ mkdir Hello
$ cd Hello
$ swift package init --type executable
$ swift build
$ .build/debug/Hello
You can run in immediate mode.
ex) swift Hello.swift
You can compile and run with dynamic library
ex)
Compile
swiftc Hello.swift
Run
Hello
You can try to run a Foundation application
ex)
Compile
swiftc TestFoundation.swift -I /usr/include
Run
TestFoundation
Notice
Compiler Source: https://github.com/tinysun212/swift-windows/releases/tag/swift-cygwin-20160913
(based on: https://github.com/apple/swift/releases/tag/swift-DEVELOPMENT-SNAPSHOT-2016-08-07-a)
Fondation Source: https://github.com/tinysun212/swift-corelibs-foundation/releases/tag/swift-cygwin-20160913
(based on: https://github.com/apple/swift-corelibs-foundation/releases/tag/swift-DEVELOPMENT-SNAPSHOT-2016-08-07-a)
Package Manger Source: https://github.com/tinysun212/swift-package-manager/releases/tag/swift-cygwin-20160913
(based on: https://github.com/apple/swift-package-manager/releases/tag/swift-DEVELOPMENT-SNAPSHOT-2016-08-07-a)
llbuild Source: https://github.com/tinysun212/swift-llbuild/releases/tag/swift-cygwin-20160913
(based on: https://github.com/apple/swift-llbuild/releases/tag/swift-DEVELOPMENT-SNAPSHOT-2016-08-07-a)