Skip to content

Swift compiler for Cygwin

Compare
Choose a tag to compare
@tinysun212 tinysun212 released this 14 Oct 15:25
· 5 commits to upstream-with-windows since this release

What is this?

  • Swift compiler for Cygwin 64bit
  • Support Swift language 3.1
  • Newlib module is included. It is a Glibc-like module for the Cygwin C runtime library.

Install

  1. Install Cygwin v2.9.0 64bit.
  2. In addition to the default Cygwin package, you should select some packages.
    clang (4.0.1-1), libiconv-devel (1.14-3), libicu-devel (58.2-1)
  3. Download and extract swift-cygwin-20171014-bin.tar.gz.
  4. Add the Swift toolchain to your path.
    export PATH=$PATH:(your swift directory)/bin

How to run your Swift code

  • You can run in immediate mode.
    ex) swift Hello.swift

  • You can compile and run.
    ex)

    Compile
      swiftc Hello.swift
    
    Run
      Hello
    
  • You can try to run a Foundation application.
    ex)

    Compile
      swiftc TestFoundation.swift
    
    Run
      TestFoundation
    

Notice