voddan voddan - 9 months ago 36
Swift Question

Build a Swift project in CLion

I am trying to build a simple project in CLion 2016.1, Swift plugin.

I followed instructions here http://blog.jetbrains.com/clion/2015/12/swift-plugin-for-clion/ and https://youtrack.jetbrains.com/issue/CPP-5326

When I try to build the CLion project, it gives me:

error: no Package.swift file found

Shouldn't that be handled by CLion? What is a correct configuration?

Answer Source

Since CLion uses Swift build system I had to set up a Swift package like described here: https://swift.org/getting-started/#using-the-build-system

The structure must be the following:

 - Package.swift
 - Sources
 - - - main.swift

After that swift build worked as expected.