{"id":27392,"date":"2021-01-21T18:53:11","date_gmt":"2021-01-21T18:53:11","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cppblog\/?p=27392"},"modified":"2021-01-21T23:20:13","modified_gmt":"2021-01-21T23:20:13","slug":"windows-arm64-support-for-cmake-projects-in-visual-studio","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/windows-arm64-support-for-cmake-projects-in-visual-studio\/","title":{"rendered":"Windows ARM64 support for CMake projects in Visual Studio"},"content":{"rendered":"<p>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 <a href=\"https:\/\/docs.microsoft.com\/en-us\/visualstudio\/debugger\/remote-debugging-cpp?view=vs-2019\">Visual Studio remote tools.<\/a> 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 <a href=\"https:\/\/visualstudio.microsoft.com\/vs\/preview\/\">here<\/a>.<\/p>\n<p>For step-by-step instructions of this workflow, check out the <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/build\/cmake-remote-debugging?view=msvc-160\">Tutorial: Debug a CMake project on a remote Windows machine<\/a>. 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.<\/p>\n<p>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 <a href=\"https:\/\/docs.microsoft.com\/en-us\/visualstudio\/debugger\/remote-debugging-cpp?%2523download-and-install-the-remote-tools=&amp;view=vs-2019#download-and-install-the-remote-tools\">remote tools<\/a> on your target machine. In this scenario, your target machine is the ARM64 Windows machine where you will be running and debugging your program.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2021\/01\/arm64_latest.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-27421\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2021\/01\/arm64_latest.png\" alt=\"The Visual Studio Installer is open. The individual component &quot;ARM64 build tools (latest)&quot; is selected for installation.\" width=\"719\" height=\"304\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2021\/01\/arm64_latest.png 719w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2021\/01\/arm64_latest-300x127.png 300w\" sizes=\"(max-width: 719px) 100vw, 719px\" \/><\/a><\/p>\n<p>Install the latest version of the ARM64 build tools on your host machine.<\/p>\n<h4>Cross-compile CMake projects for ARM64<\/h4>\n<p>You can now <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/build\/cmake-remote-debugging?view=msvc-160#configure-for-arm64\">add a new CMake configuration<\/a> of type <strong>arm64-Debug<\/strong> or <strong>arm64-Release<\/strong> to the CMake Settings Editor. You can also modify existing CMake configurations to build with the <strong>msvc_arm64_x64, clang_cl_arm64_x64, <\/strong>\u00a0<strong>msvc_arm64, <\/strong>or <strong>clang_cl_arm64<\/strong> toolset. <strong>arm64_x64<\/strong> toolsets select 64-bit host tools to cross-compile for ARM64, and <strong>arm64<\/strong> toolsets select 32-bit host tools to cross-compile for ARM64.<a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2021\/01\/arm64-newconfig.png\"><img decoding=\"async\" class=\"aligncenter wp-image-27394\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2021\/01\/arm64-newconfig.png\" alt=\"The dialog to add a new configuration to the CMake Settings Editor in Visual Studio is open. The new template of type &quot;arm64-Debug&quot; is highlighted.\" width=\"700\" height=\"444\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2021\/01\/arm64-newconfig.png 1156w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2021\/01\/arm64-newconfig-300x190.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2021\/01\/arm64-newconfig-1024x649.png 1024w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2021\/01\/arm64-newconfig-768x487.png 768w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/a><\/p>\n<h4>Debug CMake projects on a remote Windows machine<\/h4>\n<p><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/build\/cmake-remote-debugging?view=msvc-160#add-a-debug-configuration-file\">Add a new debug configuration<\/a> of type <strong>C\/C++ Remote Windows Debug <\/strong>to launch.vs.json to debug your project on a remote Windows machine. You will need to set the value of <strong>remoteMachineName<\/strong> to the IP address of your remote ARM64 machine that hosts the remote tools. You may also need to update the value of <strong>authenticationType <\/strong>to match the authentication mode set on your remote machine. For more information and a sample launch.vs.json file, check out the <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/build\/cmake-remote-debugging?view=msvc-160#add-a-debug-configuration-file\">remote debugging tutorial<\/a>.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2021\/01\/remote-debugger-options.png\"><img decoding=\"async\" class=\"aligncenter wp-image-27396\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2021\/01\/remote-debugger-options.png\" alt=\"The remote debugging tool options window is open. The authentication mode setting is highlighted and the mode &quot;Windows Authentication&quot; is selected.\" width=\"650\" height=\"488\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2021\/01\/remote-debugger-options.png 816w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2021\/01\/remote-debugger-options-300x225.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2021\/01\/remote-debugger-options-768x577.png 768w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/a><\/p>\n<p>Note: Visual Studio\u2019s support for remote Linux development requires you to add an SSH connection to your remote machine in the <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/linux\/connect-to-your-remote-linux-computer?view=msvc-160&amp;viewFallbackFrom=vs-2019\">Connection Manager<\/a>. Remote Windows deployment does not require you to use the Connection Manager because it communicates over the Windows remote debugger (<strong>msvsmon.exe<\/strong>) instead of SSH.<\/p>\n<p>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\u2019s debugging features as if you were debugging locally on your host system.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2021\/01\/remote-cmake-app.png\"><img decoding=\"async\" class=\"aligncenter wp-image-27398\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2021\/01\/remote-cmake-app.png\" alt=\"An executable is running in a Windows terminal. The program output reads &quot;Hello CMake.&quot; \" width=\"800\" height=\"181\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2021\/01\/remote-cmake-app.png 1131w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2021\/01\/remote-cmake-app-300x68.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2021\/01\/remote-cmake-app-1024x232.png 1024w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2021\/01\/remote-cmake-app-768x174.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n<h4>Give us your feedback<\/h4>\n<p>Download\u00a0<a href=\"https:\/\/visualstudio.microsoft.com\/vs\/preview\/\">Visual Studio 2019 version 16.9 Preview 3<\/a>\u00a0today and give it a try. We\u2019d love to hear from you to help us prioritize and build the right features for you. We can be reached via the comments below,\u00a0<a href=\"https:\/\/developercommunity.visualstudio.com\/spaces\/8\/index.html\">Developer Community<\/a>, and Twitter (<a href=\"https:\/\/twitter.com\/visualc\">@VisualC<\/a>). The best way to file a bug or suggest a feature is via Developer Community.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":2953,"featured_media":27394,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[270,1,266],"tags":[],"class_list":["post-27392","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-announcement","category-cplusplus","category-cmake"],"acf":[],"blog_post_summary":"<p>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 [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/27392","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/2953"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=27392"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/27392\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/27394"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=27392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=27392"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=27392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}