MSBuild VCBuild VBBuild Features for Visual C++ Project

MSBuild Features for Visual C++

MSBuild is the build platform that Microsoft is using across all developer and related tools moving forward. Visual C++ is the last major compiler offering from Microsoft to move onto the MSBuild platform, with the Visual C++ 2010 release using MSBuild as its native project format. Explore the MSBuild basics from a C++ perspective, and see how it can improve your build process.
The move in Visual C++ 2010 to MSBuild is a great step forward for Visual C++ developers. At first glance, the use of a different file format for Visual C++ projects may cause reactions ranging from indifference to concern over disruptions and breakages to any existing customizations to the build process. However, by allowing Visual C++ builds to take advantage of the wide variety of extensibility points in the MSBuild engine, the limited extensibility of the VCPROJ format looks primitive by comparison.

MSBuild: The Basics

In some ways, the use of MSBuild as the file format for Visual C++ is a back-to-the-future moment for long-time C++ developers. In the early days of Visual C++, the MAK file format was preferred way to describe the build process that would compile and link a collection of source code files into a binary image. Although MAK files and the nmake tool are still supported, the file format of Visual C++ changed over the years to an XML format that was not compatible with nmake. To support Visual C++ compilations on build boxes and other machines without the Visual C++ IDE installed, VCBuild.exe was introduced; it can build based on the Visual C++ XML VCPROJ file format. A degree of MSBuild support is available in Visual C++ 2008 and below with the VBBuild MSBuild task, but this treats the Visual C++ compilation as a black box, and does not allow easy integration with the rest of MSBuild’s features.

Visual C++ 2010 uses MSBuild as the native project file format for C++. This offers a number of advantages for C++ developers—MSBuild is extremely flexible in the ways a build process can be customized, and custom task development for MSBuild is simple (tasks are the 'doing' things in MSBuild, and they will be covered in more details later in this article). Microsoft ships dozens of MSBuild Tasks out-of-the-box, with functionality ranging from copying files to registering assemblies to signing a file with a certificate. There is also a rich range of community and commercial tasks available for more advanced tasks, and the Exec task can be used to call out to existing command-line based build tools.