Main objective of this project is to show the best way of compiling and debug a WSL application.
NOTE: cmake tool will be used to compile the project
In order to set your environment please follow the following instructions:
- Enable and install your prefered linux distribution
- Create a new project and set it up acordingly (use this project as a template)
- Build your project
- Debug
The build, for now, is acomplish by using tasks functionality:
So to enable the automatic configuration and build you can add for example the following task to configure:
{
"label": "ReConfigure",
"type": "shell",
"command":
"rm -rf /mnt/c/yourpath/build && mkdir /mnt/c/yourpath/build && cd /mnt/c/yourpath/build && cmake .."
}
and then the build task:
{
"label": "Build",
"type": "shell",
"command":
"cmake --build /mnt/c/yourpath/build",
"group": {
"kind": "build",
"isDefault": true
}
Note that is defined as the default build task, so doing the Ctrl + Shift + B will build the project.
Also note that your are providing the paths to the mounted disk on your WSL system (this to work your vs code integrated terminal must be configured to use the WSL system desired)
NOTE: the desired way should be using the CMake extension... but I can't figure out on how to do that...
Debug is acomplish by doing the following: Windows 10's Windows Subsystem for Linux
Use the CMake extension to build the project