Windows ARM64 support for CMake projects in Visual Studio

Erika

Erika

In Visual Studio 2019 version 16.9 Preview 3 we added support for deploying CMake projects to a remote Windows machine and debugging them with the Visual Studio remote tools. CMake developers targeting ARM64 Windows can now cross-compile (with cl or clang-cl), deploy, and debug their projects directly from Visual Studio. You can download and install the latest preview of Visual Studio here.

For step-by-step instructions of this workflow, check out the Tutorial: Debug a CMake project on a remote Windows machine. This tutorial is specific to ARM64 development, but the steps can be generalized for other Windows architectures. An overview of the new feature set is below.

Before you get started, you will need to install the ARM64 build tools on your host machine. In this scenario, your host machine is the machine where you are building and where Visual Studio is installed. You will also need to install and configure the remote tools on your target machine. In this scenario, your target machine is the ARM64 Windows machine where you will be running and debugging your program.

The Visual Studio Installer is open. The individual component "ARM64 build tools (latest)" is selected for installation.

Install the latest version of the ARM64 build tools on your host machine.

Cross-compile CMake projects for ARM64

You can now add a new CMake configuration of type arm64-Debug or arm64-Release to the CMake Settings Editor. You can also modify existing CMake configurations to build with the msvc_arm64_x64, clang_cl_arm64_x64,  msvc_arm64, or clang_cl_arm64 toolset. arm64_x64 toolsets select 64-bit host tools to cross-compile for ARM64, and arm64 toolsets select 32-bit host tools to cross-compile for ARM64.The dialog to add a new configuration to the CMake Settings Editor in Visual Studio is open. The new template of type "arm64-Debug" is highlighted.

Debug CMake projects on a remote Windows machine

Add a new debug configuration of type C/C++ Remote Windows Debug to launch.vs.json to debug your project on a remote Windows machine. You will need to set the value of remoteMachineName to the IP address of your remote ARM64 machine that hosts the remote tools. You may also need to update the value of authenticationType to match the authentication mode set on your remote machine. For more information and a sample launch.vs.json file, check out the remote debugging tutorial.

The remote debugging tool options window is open. The authentication mode setting is highlighted and the mode "Windows Authentication" is selected.

Note: Visual Studio’s support for remote Linux development requires you to add an SSH connection to your remote machine in the Connection Manager. Remote Windows deployment does not require you to use the Connection Manager because it communicates over the Windows remote debugger (msvsmon.exe) instead of SSH.

When you run the application, Visual Studio will cross-compile locally on your host system, deploy the application to your remote Windows machine, and start debugging the application on the remote machine. You can set breakpoints and utilize Visual Studio’s debugging features as if you were debugging locally on your host system.

An executable is running in a Windows terminal. The program output reads "Hello CMake."

Give us your feedback

Download Visual Studio 2019 version 16.9 Preview 3 today and give it a try. We’d love to hear from you to help us prioritize and build the right features for you. We can be reached via the comments below, Developer Community, and Twitter (@VisualC). The best way to file a bug or suggest a feature is via Developer Community.

 

1 comment

Leave a comment