Clion Doesn't recognize my swift toolchain path
Asked Answered
C

5

7

I'm trying to configure clion for a swift project, but it just doesn't recognize the swift toolchain path.

$ which swift

produces the output

/usr/bin/swift/bin/swift

so the toolchain is there but clion just doesn't recognize it

enter image description here

How do i make this work?

Cope answered 1/5, 2017 at 16:39 Comment(0)
C
6

You should use /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain

There's /usr/bin/swift under the above directory and it makes CLion happy.

Costin answered 6/7, 2019 at 18:34 Comment(0)
H
3

I used the following successfully:

    /Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain

I'm running OS X El Capitan, Version 10.11.6 with Xcode 8.2.1

Homestead answered 3/10, 2018 at 5:44 Comment(0)
E
3

for anyone with the same problem, Cgarcia E88's comment here might help.

Apparently the path you choose must contain the folder usr underneath, so in you case it should be just / but in general if swift is located at SOME_PATH/usr/bin/swift then you must select SOME_PATH.

Esse answered 25/5, 2019 at 5:43 Comment(0)
T
1

If you are using Windows, try using
C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain

Tuition answered 2/1, 2022 at 13:20 Comment(0)
K
-2

CLion Swift plugin expects path to the whole toolchain, not the swift binary. In your case the correct patch probably would be "/usr/bin/swift"

Kreager answered 2/5, 2017 at 10:6 Comment(3)
I've fixed it, actually clion expects a directory structure of swift/usr/bin/<swift-binary> while mine was swift/bin/<swift-binary>Cope
Unable to fix it. Suggestions?Dichromaticism
@Dichromaticism Please provide more details. Which CLion & plugin versions are you using? What exactly are you entering into the field and what is the result?Kreager

© 2022 - 2024 — McMap. All rights reserved.