Swift on Windows in CLion
You may have heard that Swift is now available on Windows. We’ve been following this development closely, and we’ve decided to make it possible to use the Swift plugin in CLion on Windows. It’s now available in CLion 2021.1 EAP (211.6556.10). Let’s take a look!
Install all the required and recommended components from the official Getting Started guide (note that you need the Swift 5.4 toolchain for Windows).
Add the following items to the system
%SystemDrive%\Program Files (x86)\Microsoft Visual Studio\Shared\Python<version>(required for
lldband swift REPL)
%SystemDrive%\Library\Developer\Platforms\Windows.platform\Developer\Library\XCTest-development\usr\bin(required for XCTest)
Finally, run CLion with the Swift plugin installed and create a sample project.
The initial indexing can take a long time, since we have no caches bundled for Swift toolchains on Windows. Subsequent indexing should be much faster.
Debugging does not currently work because of several
lldb issues (such as SR-14243). We hope that they will be fixed soon and we will be able to add debugging support in the future.
Build and run
You can build and run your project on Windows in CLion just as you would on Linux or macOS:
Run configurations are created automatically, and test configurations also work.
Code assistance works just like it does on macOS and Linux:
That’s it for now! Stay tuned and keep an eye on this ticket (and related ones) for further updates.
Your AppCode team
The Drive to Develop