From 916e093d4af8697b65d3e7fe12414a0284adcb7c Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Fri, 1 Apr 2022 18:21:16 +0300 Subject: [PATCH] Documentation: Add Kernel/Userland quick switch to CLion configuration --- Documentation/CLionConfiguration.md | 21 ++++++++++++++++++ Documentation/CLion_Add_Configuration.png | Bin 0 -> 1983 bytes .../CLion_Add_Configuration_Existing.png | Bin 0 -> 1694 bytes 3 files changed, 21 insertions(+) create mode 100644 Documentation/CLion_Add_Configuration.png create mode 100644 Documentation/CLion_Add_Configuration_Existing.png diff --git a/Documentation/CLionConfiguration.md b/Documentation/CLionConfiguration.md index 8e723aca1a..a9c7abf2e4 100644 --- a/Documentation/CLionConfiguration.md +++ b/Documentation/CLionConfiguration.md @@ -56,6 +56,27 @@ following options under `Settings -> Editor -> Code Style -> C/C++`: ![Screenshot of Naming Convention settings](./CLion_Naming_Convention.png) +## Quick switching between Kernel and Userland targets + +In order to let CLion know what kind of code you're currently working on (Kernel / Userland) to make sure it parses and displays the correct half of statements like this: +```c++ +#ifdef KERNEL +... +#else +... +#endif +``` +You need to add build configurations for each: + +Click on one of the buttons below (top right of the IDE) - If you have the second one, press Edit Configurations after the dropdown box opens, then press CTRL+A to select the 1000s of automatically generated targets, and then press Delete to remove them. + +![Add Configuration...](CLion_Add_Configuration.png) +![Kernel | Default](CLion_Add_Configuration_Existing.png) + +Then press the `+` button to add a new configuration, select `CMake Application`, name the configuration `Kernel`, set the target to `Kernel` (typing while the dropdown box is open searches), and then repeat the process one more time, this time with the name being `Userland` and the target being `true`. + +Finally, to quickly switch between the two different contexts, simply click the `Kernel | Default` / `Userland | Default` button to switch. + ## Notes for WSL Users It is possible to set the embedded terminal in CLion to the one that your WSL distribution provides. diff --git a/Documentation/CLion_Add_Configuration.png b/Documentation/CLion_Add_Configuration.png new file mode 100644 index 0000000000000000000000000000000000000000..f289181b5f93ebdc2ba261137e714cf274579277 GIT binary patch literal 1983 zcmeAS@N?(olHy`uVBq!ia0y~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