From 1d502dfd7cb2420fd9651a45d1477e90f66bb595 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Tue, 4 Jun 2024 15:30:09 -0600 Subject: [PATCH] Documentation: Update IDE docs to reference CMakePresets.json --- Documentation/CLionConfiguration.md | 16 +++++---------- Documentation/CLion_Add_Configuration.png | Bin 1983 -> 0 bytes .../CLion_Add_Configuration_Existing.png | Bin 1694 -> 0 bytes Documentation/QtCreatorConfiguration.md | 19 +++++------------- Documentation/VSCodeConfiguration.md | 10 +++++++-- 5 files changed, 18 insertions(+), 27 deletions(-) delete mode 100644 Documentation/CLion_Add_Configuration.png delete mode 100644 Documentation/CLion_Add_Configuration_Existing.png diff --git a/Documentation/CLionConfiguration.md b/Documentation/CLionConfiguration.md index 54e138aeea4..26627413331 100644 --- a/Documentation/CLionConfiguration.md +++ b/Documentation/CLionConfiguration.md @@ -2,19 +2,13 @@ CLion can integrate with CMake to provide code comprehension features. -After opening the `ladybird` repository in CLion as a new project, the "`Open Project Wizard`" window will open, from here set the following fields: +After opening the `ladybird` repository in CLion as a new project, the "`Open Project Wizard`" window will open. -(Assuming you use `Ninja` as the build system and configured the CMake build directory to `Build/ladybird`) +Select the `default` Preset in the `Settings -> Build, Execution and Deployment -> CMake` window and click the `Enable Profile` checkbox. -`CMake Options`: -``` --DSERENITY_CACHE_DIR=$CMakeProjectDir$/Build/caches --GNinja -``` - -`Build Directory`: `Build/ladybird` - -If you already have the project open, you can go to `File -> Settings -> Build, Execution, Deployment -> CMake` to find these options. +If the build complains that there is no `Default` Toolchain, go to the `Settings -> Build, Execution and Deployment -> Toolchains` +tab and copy the currently defaulted host toolchain and rename it to `Default`. Make sure that the compiler chosen has a version of +at least gcc-13 or clang-17. ## Excluding Build Artifacts diff --git a/Documentation/CLion_Add_Configuration.png b/Documentation/CLion_Add_Configuration.png deleted file mode 100644 index f289181b5f93ebdc2ba261137e714cf274579277..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1983 zcmV;w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|uo#iyeWhj8tt>p}ZY(LiLKfqq4c$)$TGCpy+g5R$3}VHm z`@>r)oy=VLlAh0LYYs-E8GX_atW&dC`W-V9!!+~8nj1NZgot{^we)c%aBlMgq z1JAizk(7?{C|%MCXvqqiI93Gfq!M2Ty>k!A@Gm%R78uN9c;g8}KAcByEh*0=GyHuT zPx|{|d@>3{$5lME=71zw&_DbfuH7i)fYL7g6r)(bbTV_fwxopaIr!xi)+Zm9Fn;Fx z1D{5r?bN4v*j$(Hr>Er=@|OQ!XuS8mze2 z;o00_Ldr-Tx*ZMAxm%O;!GgCS*>#IbdJ;w`mB7|3ef}2TV8dD>fi+vpRZQc+jvT>) znS9SA^YE>K>YEXN{2l>0fVtjM`lXYZOIeauTd}O%s|G$8OBkPV{Y>%9C^?Bk6l%3F9-a|D0CKG?q5~2u7kf4IUvBlM$RZ zpO-VFtAM10?%qE9@N8cSNlM%18A(lPBK~XY)Omu+k@Ey8T-y2Mp+q>(g&xa<1?;bp~|{~r2G@(O&75?yx7W? zR13$hjOg;n)ic!`N$GiIr1j7CGOnRChDU8_=y)-B&ixTd`7jb%t%c3493Ubau%{0| zb?BbkSHwNSnsX9^77HZn1YVAtP?K)MP9`&+Eosqy+c32$Bkp|vNLHiswjLtlt{co8Mr=AAxUHo+F_lvCCl9~<-yxYJ*ggkmXLnL&Bf49EErpuJm z^QzKVF~50?sB&K%4en!gvWptCGVq+c6-loH-TwaqUs6G-@SMA`q=F1W(woC`uArpi zRlU*?lHQE6UeyyXJqzxVvR--?KOYg?1vmQni1;C%;I1h9hj;>kS`d;7RF9BUpnC4z ozkeSBftnF3sX+AzNd>CsKe+n#k(rcA>Hq)$07*qoM6N<$f?kn1!2kdN diff --git a/Documentation/QtCreatorConfiguration.md b/Documentation/QtCreatorConfiguration.md index e45fecd0edd..9d47ac91bbe 100644 --- a/Documentation/QtCreatorConfiguration.md +++ b/Documentation/QtCreatorConfiguration.md @@ -16,11 +16,8 @@ First, make sure you have a working toolchain and can build and run Ladybird. Go * Add the following `#define`s to the file: ``` #define ENABLE_UNICODE_DATA 1 - //#define ENABLE_COMPILETIME_FORMAT_CHECK - - #define __serenity__ + #define ENABLE_COMPILETIME_FORMAT_CHECK #define SANITIZE_PTRS 1 - #define __SSE__ ``` * Edit the `ladybird.cxxflags` file to say `-std=c++23 -fsigned-char -fconcepts -fno-exceptions -fno-semantic-interposition -fPIC` * Edit the `ladybird.includes` file to list the following lines: @@ -29,11 +26,10 @@ First, make sure you have a working toolchain and can build and run Ladybird. Go Userland/ Userland/Libraries/ Userland/Services/ - Toolchain/Local/x86_64/x86_64-pc-serenity/include/c++/13.1.0 - Build/x86_64/ - Build/x86_64/Userland/ - Build/x86_64/Userland/Libraries/ - Build/x86_64/Userland/Services/ + Build/ladybird/ + Build/ladybird/Userland/ + Build/ladybird/Userland/Libraries/ + Build/ladybird/Userland/Services/ AK/ ``` @@ -87,8 +83,3 @@ In QtCreator, select the menu "Tools", item "Options", section "C++", tab "File Naming" (don't ask me why it's here). At the bottom there should be the option "License template:". Click "Browse…", select your file (i.e., `license-template.creator`). Click "OK", and you're done! :) - -## Compiler Kits - -You can slightly improve how well Qt interprets the code by adding and setting up an appropriate "compiler kit". -For that you will need to reference the compilers at `Toolchain/Local/x86_64/bin/x86_64-pc-serenity-gcc` and `Toolchain/Local/x86_64/bin/x86_64-pc-serenity-g++`. diff --git a/Documentation/VSCodeConfiguration.md b/Documentation/VSCodeConfiguration.md index 240056b7492..4407e756ad1 100644 --- a/Documentation/VSCodeConfiguration.md +++ b/Documentation/VSCodeConfiguration.md @@ -6,12 +6,18 @@ The WSL Remote extension allows you to use VS Code in Windows while using the no The recommended extensions for VS Code include: +- [CMake Tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) - [clangd](https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd) - [GitLens](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens) +## Configuration + +The CMake Tools plugin should automatically detect the `CMakePresets.json` at the root of the repository. +Selecting and activating the `default` preset should be enough to get started. + ## Code comprehension -Clangd has the best support for cross-compiling workflows, especially if configured as noted below. The Microsoft C/C++ tools can work, but require a lot more configuration and may not understand the sysroot in use. +Clangd has the best support for modern compilers, especially if configured as noted below. The Microsoft C/C++ tools can work, but may require more configuration. ### clangd @@ -126,7 +132,7 @@ These belong in the `.vscode/settings.json` of Serenity. "Toolchain/Build/**": true, "Build/**": true, }, - // Force clang-format to respect Serenity's .clang-format style file. This is not necessary if you're not using the Microsoft C++ extension. + // Force clang-format to respect Ladybird's .clang-format style file. This is not necessary if you're not using the Microsoft C++ extension. "C_Cpp.clang_format_style": "file", // Tab settings "editor.tabSize": 4,