Run/debug ion code in CLion with Ion plugin installed
- Configure IONHOME/IONPATH at
File | Settings | Languages & Frameworks | Ion
- Add ion run configuration compiling ion to c:
- create a new Ion configuration at
Run | Edit Configurations...
- set the packageName you want to build, add ion arguments
-o out.c
- running this configuration will produce navigatable compilation errors in the console
- create a new Ion configuration at
- Create a custom build target called
cc
atFile | Settings | Build, Execution, Deployment | Custom Build Targets
: Press...
near Build and add a new External Command: Program:cc
, Arguments:out.c -o out -g
, Working Directory:$ProjectFileDir$
(this works on linux, windows needs something else) - Create an empty file called
out
in the project dir - Create a new
Custom Build Application
run configuration calledrunIon
atRun | Edit Configurations...
with:- Target: cc (which was create in step 3)
- Executable: out (the file has to exist so that you can select it)
- Click
+
below 'Before Lunch' in the bottom and selectRun another configuration
and select ion configuration created in the second step, make it the first step to run
Now one can run/debug ion code by running/debugging the runIon
configuration