{"id":9004,"date":"2016-09-07T19:30:36","date_gmt":"2016-09-07T18:30:36","guid":{"rendered":"https:\/\/sysprogs.com\/w\/?p=9004"},"modified":"2016-09-07T19:35:15","modified_gmt":"2016-09-07T18:35:15","slug":"10-reasons-to-try-out-msbuild-for-your-visualgdb-projects","status":"publish","type":"post","link":"https:\/\/sysprogs.com\/w\/10-reasons-to-try-out-msbuild-for-your-visualgdb-projects\/","title":{"rendered":"10 Reasons to Try Out MSBuild for your VisualGDB Projects"},"content":{"rendered":"<p>We have just released VisualGDB 5.2 Preview 3 that comes with out-of-the-box MSBuild support for Embedded and Linux projects (using both remote\u00a0toolchains and Windows cross-toolchains).\u00a0It is a lucrative alternative to the GNU Make and CMake build systems\u00a0that VisualGDB supports as well, so let&#8217;s go through the main 10 reasons why it&#8217;s worth\u00a0checking out.<\/p>\n<p><!--more--><\/p>\n<h3>1. Much\u00a0Faster Builds<\/h3>\n<p>The main build system used by VisualGDB before version 5.2 \u00a0was GNU Make. Although being simple and wide-spread, it is not exactly known for very high performance on Windows. So we designed our MSBuild back-end to spend\u00a0no processor time on anything except the build. The result is clear: almost\u00a0twice\u00a0faster build time.\u00a0For example, building a typical STM32-based Embedded project on an 8-core system only takes 1.2 seconds.<\/p>\n<h3>2.\u00a0Easy\u00a0Precompiled Headers<\/h3>\n<p>With older VisualGDB and\u00a0GNU Make you could setup precompiled headers for your project, but that would require complex\u00a0modifications to the Makefile. The new MSBuild back-end makes precompiled headers easy: add\u00a0a source file that will create a precompiled header\u00a0and configure the rest of the files\u00a0to use them. VisualGDB will take care of the rest.<\/p>\n<p><a href=\"https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/pchsettings.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-9006\" src=\"https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/pchsettings-1024x722.png\" alt=\"pchsettings\" width=\"474\" height=\"334\" srcset=\"https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/pchsettings-1024x722.png 1024w, https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/pchsettings-300x212.png 300w, https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/pchsettings-768x542.png 768w, https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/pchsettings.png 1134w\" sizes=\"(max-width: 474px) 100vw, 474px\" \/><\/a><\/p>\n<h3>3. Smart Shared &amp; Static Libraries<\/h3>\n<p>In normal Visual Studio projects you can reference a library project to get it linked with your current\u00a0project.\u00a0While being convenient, this still requires you to\u00a0add settings like include directories to each referencing project\u00a0in order to\u00a0access the library headers. VisualGDB takes this further by\u00a0introducing exported settings:<a href=\"https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/shlib.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-9008\" src=\"https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/shlib.png\" alt=\"shlib\" width=\"822\" height=\"558\" srcset=\"https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/shlib.png 822w, https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/shlib-300x204.png 300w, https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/shlib-768x521.png 768w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/><\/a>Each library can now export a set of include directories (relative to the library\u00a0project directory), preprocessor definitions, forced includes and extra linker settings. When you reference the library from a project, those settings will be automatically merged with your project settings, saving you the effort of doing it manually.<\/p>\n<h3>4. Smart and Precise IntelliSense<\/h3>\n<p>If you are\u00a0building your project\u00a0on a remote Linux system,\u00a0VisualGDB will automatically\u00a0make a list of the include directories it is using and cache them\u00a0on your Windows machine so that\u00a0IntelliSense can easily find them. You can\u00a0see the\u00a0list of those directories and reload them via VisualGDB Project Properties:<a href=\"https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/sensedirs.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-9009\" src=\"https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/sensedirs.png\" alt=\"sensedirs\" width=\"1001\" height=\"699\" srcset=\"https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/sensedirs.png 1001w, https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/sensedirs-300x209.png 300w, https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/sensedirs-768x536.png 768w\" sizes=\"(max-width: 1001px) 100vw, 1001px\" \/><\/a><\/p>\n<h3>5. Excluded Files and Per-file Settings<\/h3>\n<p>If you use MSBuild to build your VisualGDB projects, you can\u00a0exclude some of your sources from certain configurations\u00a0and override\u00a0any compiler settings like optimization for individual files:<a href=\"https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/exclude.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-9010\" src=\"https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/exclude.png\" alt=\"exclude\" width=\"822\" height=\"558\" srcset=\"https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/exclude.png 822w, https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/exclude-300x204.png 300w, https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/exclude-768x521.png 768w\" sizes=\"(max-width: 822px) 100vw, 822px\" \/><\/a><\/p>\n<h3>6.\u00a0Resources for Embedded Projects<\/h3>\n<p>If you want to embed resources like constant\u00a0tables, images or voice messages in your embedded projects,\u00a0the new MSBuild back-end makes it really easy. \u00a0Simply add those files to the project, ensure their type is set to &#8220;Embedded Binary File&#8221; and\u00a0VisualGDB will automatically convert them into global variables\u00a0accessible from your code:<a href=\"https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/binary.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-9011\" src=\"https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/binary.png\" alt=\"binary\" width=\"934\" height=\"292\" srcset=\"https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/binary.png 934w, https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/binary-300x94.png 300w, https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/binary-768x240.png 768w\" sizes=\"(max-width: 934px) 100vw, 934px\" \/><\/a><\/p>\n<h3>7. Quick Up-to-date Check<\/h3>\n<p>If you were ever annoyed by the &#8220;Project out of date&#8221; message\u00a0shown\u00a0when you try to debug a VisualGDB project\u00a0without actually modifying it,\u00a0we&#8217;ve got good news for you. The new\u00a0MSBuild back-end\u00a0replaces the normal Visual Studio out-of-date check for VisualGDB projects, so you will never see this message again unless the project is actually out of date:<a href=\"https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/rebuild.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-9012\" src=\"https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/rebuild.png\" alt=\"rebuild\" width=\"345\" height=\"317\" srcset=\"https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/rebuild.png 345w, https:\/\/sysprogs.com\/w\/wp-content\/uploads\/2016\/09\/rebuild-300x276.png 300w\" sizes=\"(max-width: 345px) 100vw, 345px\" \/><\/a><\/p>\n<p>Note that this only works starting from Visual Studio 2015.<\/p>\n<h3>8. Smarter Rebuild<\/h3>\n<p>Yet another small annoyance of the GNU Make build system is that adding new files to\u00a0your project or changing some of the build flags\u00a0triggers a full rebuild of the entire project. The new VisualGDB MSBuild back-end goes smarter about this and only\u00a0rebuilds the files when they (or any included headers) are modified\u00a0or their build\u00a0command line actually changes. One less thing to worry about.<\/p>\n<h3>9. Long\u00a0Command Line Support<\/h3>\n<p>Some\u00a0embedded SDKs\u00a0like <a href=\"http:\/\/visualgdb.com\/w\/tutorials\/tag\/nrf51\/\">Nordic nRF51<\/a> are notorious for having lots of header files scattered around the SDK, that results in huge\u00a0command lines when it comes to building your projects. This can quickly fill up\u00a0the 8191-character command line length limit\u00a0causing annoying build problems. The new MSBuild\u00a0back-end takes care of this by using response files instead of command lines, so you will never see this problem again.<\/p>\n<h3>10.\u00a0Building Single Files<\/h3>\n<p>Sometimes\u00a0when you doing massive project changes, you want to build files one-by-one to\u00a0focus on errors in each file. While not\u00a0being possible for GNU\u00a0Make and CMake projects, this is natively\u00a0supported for\u00a0MSBuild projects.\u00a0Simply press Ctrl-F7 and VisualGDB will build\u00a0the currently open file\u00a0same way it works for normal Windows projects.<\/p>\n<h2>Remote projects<\/h2>\n<p>Our new MSBuild back-end also works with projects built remotely over SSH. Before you ask, it doesn&#8217;t\u00a0go crazy about trying to\u00a0check thousands of remote\u00a0source files for being out-of-date\u00a0or\u00a0try to run numerous\u00a0commands over a high-latency SSH channel. Instead it simply generates a temporary Makefile, checks\u00a0if it has changed from the\u00a0last build, uploads it along with any\u00a0changed source files and kicks off a remote instance of the good-old GNU Make. All the features\u00a0like per-file settings and rebuilding only the actually modified files\u00a0still work transparently.<\/p>\n<h2>Downloading<\/h2>\n<p>You can download VisualGDB 5.2 Preview 3 with support for MSBuild from the <a href=\"http:\/\/visualgdb.com\/download\/\">download page <\/a>(C\/C++ MSBuild\u00a0projects are only supported starting from Visual Studio 2010 and won&#8217;t work on VS2008).\u00a0We&#8217;ll be excited to hear your feedback about the new features through our<a href=\"http:\/\/sysprogs.com\/support\/\"> support form <\/a>or by email. Enjoy VisualGDB.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We have just released VisualGDB 5.2 Preview 3 that comes with out-of-the-box MSBuild support for Embedded and Linux projects (using both remote\u00a0toolchains and Windows cross-toolchains).\u00a0It is a lucrative alternative to the GNU Make and CMake build systems\u00a0that VisualGDB supports as well, so let&#8217;s go through the main 10 reasons why it&#8217;s worth\u00a0checking out.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[1],"tags":[216],"_links":{"self":[{"href":"https:\/\/sysprogs.com\/w\/wp-json\/wp\/v2\/posts\/9004"}],"collection":[{"href":"https:\/\/sysprogs.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sysprogs.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sysprogs.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sysprogs.com\/w\/wp-json\/wp\/v2\/comments?post=9004"}],"version-history":[{"count":11,"href":"https:\/\/sysprogs.com\/w\/wp-json\/wp\/v2\/posts\/9004\/revisions"}],"predecessor-version":[{"id":9020,"href":"https:\/\/sysprogs.com\/w\/wp-json\/wp\/v2\/posts\/9004\/revisions\/9020"}],"wp:attachment":[{"href":"https:\/\/sysprogs.com\/w\/wp-json\/wp\/v2\/media?parent=9004"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sysprogs.com\/w\/wp-json\/wp\/v2\/categories?post=9004"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sysprogs.com\/w\/wp-json\/wp\/v2\/tags?post=9004"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}