6/12/2023 0 Comments Visual studio cmake linuxIn this tutorial I’ll use GCC and Ninja on Ubuntu. Sudo apt install g++ gdb make ninja-build rsync zip You can install these dependencies on distros that use apt with the following commands: You will need a C++ compiler, gdb, CMake, an underlying build system generator, rsync, and zip. Follow the instructions below to build and debug a CMake project on a WSL 2 distro.ġ) Install WSL and a WSL 2 distro with the Windows Subsystem for Linux Installation Guide for Windows 10.Ģ) Install the required build tools on your WSL 2 distro. You can learn more about CMake Presets in our announcement blog post and documentation. The WSL 2 toolset is supported by our CMake Presets integration in Visual Studio. Cross-platform CMake development with a WSL 2 distro See Comparing WSL 1 and WSL 2 to learn more about the differences between WSL 1 and WSL 2.Ĭontinue reading for a step-by-step guide on getting started with CMake and WSL 2 and an overview of our MSBuild-based WSL 2 support. This local rsync copy will occur automatically when Visual Studio detects that you are using a WSL 2 distro and will require no user intervention. When targeting a WSL 2 distro, Visual Studio will execute a local rsync copy to copy files from the Windows file system to the WSL file system. Our C++ cross-platform support in Visual Studio assumes that all source files originate in the Windows file system. However, CMake is our recommendation for all C++ cross-platform development with Visual Studio because it allows you to build and debug the same project on Windows, WSL, and remote systems. Visual Studio’s WSL 2 toolset supports both CMake and MSBuild-based Linux projects.
0 Comments
Leave a Reply. |