Skip to content

Instantly share code, notes, and snippets.

@nd
Last active March 1, 2020 19:33
Show Gist options
  • Save nd/9234fd3dd37ecd8a0d68ca32e62a8252 to your computer and use it in GitHub Desktop.
Save nd/9234fd3dd37ecd8a0d68ca32e62a8252 to your computer and use it in GitHub Desktop.
Building, running and debugging ion code in CLion without cmake

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 custom build target called cc at File | 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 called runIon at Run | 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 select Run 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

@nd
Copy link
Author

nd commented Mar 1, 2020

dbg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment