diff --git a/doc/vscode/readme.md b/doc/vscode/readme.md index 6f6aa15718a99a39e1e116159c24076b08945992..f167b94db624f650d8a8ae7922fa4c0e469dcff6 100644 --- a/doc/vscode/readme.md +++ b/doc/vscode/readme.md @@ -2,7 +2,7 @@ 1. Follow these sections of [the tutorial for compiling Inkscape on Windows](../building/windows.md): - 1. _Compiling Inkscape on Windows_ **or** _Installing Build Dependencies Manually_ + 1. _Installing Build Dependencies Easily_ **or** _Installing Build Dependencies Manually_ 0. _Obtaining Inkscape Source_ @@ -18,7 +18,8 @@ 0. Open the command palette (Ctrl + Shift + P) and enter `> Open User Settings (JSON)`. -0. In the file that opens, add the following. This will allow you to launch the relevant MSYS2 terminals from within VS Code (Ctrl + \`) for convenience. If `terminal.integrated.profiles.windows` already exists, just add the items `UCRT` and `MSYS` to it. Note the presence of commas between adjacent list items. +0. In the file that opens, add this data. This will allow you to launch the relevant MSYS2 terminals from within VS Code (Ctrl + \`) for convenience. + ```json "terminal.integrated.profiles.windows": { "UCRT": { @@ -34,17 +35,30 @@ } ``` + This data goes between the outermost curly brackets. If you've just installed VS Code, the file will have only those brackets. + + Otherwise, note the presence of commas between adjacent list items. If `terminal.integrated.profiles.windows` already exists, just add the items `UCRT` and `MSYS` to it. + 0. Save and close `settings.json`. -0. Open the folder with your clone of the Inkscape repository. You can open a folder with `File > Open Folder...`. +0. Open the folder with your clone of the Inkscape repository. You can open a folder with `File > Open Folder...`. Choose to trust the folder when prompted. -0. To build Inkscape, I recommend trying via the terminal first to make it easier to troubleshoot. You can do that in VS Code: in the command palette, enter `> Create New Terminal (With Profile)` and choose `UCRT`. +0. To build Inkscape, I recommend trying via the terminal first to make it easier to troubleshoot. You can do that in VS Code: in the command palette, enter `> Create New Terminal (With Profile)` and choose `UCRT`. Do not build with the `MSYS` shell. + + Enter these commands: + + ```bash + mkdir build + cd build + cmake -G Ninja -DCMAKE_INSTALL_PREFIX="${PWD}/install_dir" -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF -DWITH_INTERNAL_2GEOM=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .. + ninja install + ``` - At this point you can follow [the commands from the compilation tutorial](../building/windows.md#building-inkscape-with-msys2). + For details, see [the regular Windows tutorial (§ _Building Inkscape with MSYS2_)](../building/windows.md#building-inkscape-with-msys2). - (Footnote: The build flag `-DCMAKE_EXPORT_COMPILE_COMMANDS=ON` in the standard build commands tells CMake to output `build/compile_commands.json`. [c_cpp_properties.json](./c_cpp_properties.json) tells IntelliSense to use this to understand the code, preventing a lot of false errors.) + > **Footnote:** The build flag `-DCMAKE_EXPORT_COMPILE_COMMANDS=ON` tells CMake to output `build/compile_commands.json`. [c_cpp_properties.json](./c_cpp_properties.json) has IntelliSense use this to understand the code, preventing a lot of false errors. -0. To make the build process more convenient, [tasks.json](./tasks.json) defines tasks called `CMake` and `Ninja Install` that you can run via the command palette by entering `task ` followed by the name. These require the `build` folder to exist. +0. To make the build process more convenient, [tasks.json](./tasks.json) defines tasks called `CMake` and `Ninja Install` that you can run via the command palette by entering `task ` (no `>`) followed by the name. These require the `build` folder to exist. In addition, Ctrl + Shift + B is bound to the "default build task", which will be `Ninja Install` by default. diff --git a/doc/vscode/tasks.json b/doc/vscode/tasks.json index 0d2f41b5cd4c69f553265c9604c015abb9319221..b6bb07c8b5923df5ebd27acbf483b3fe485b635f 100644 --- a/doc/vscode/tasks.json +++ b/doc/vscode/tasks.json @@ -13,7 +13,7 @@ "args": ["-lc"] }, "env": { - "MSYSTEM": "MINGW64", + "MSYSTEM": "UCRT64", "CHERE_INVOKING": "1" } }, @@ -33,7 +33,7 @@ "args": ["-lc"] }, "env": { - "MSYSTEM": "MINGW64", + "MSYSTEM": "UCRT64", "CHERE_INVOKING": "1" } },