2.5.12.24. Visual C++
These steps are meant to handle compilation using Microsoft compilers.
VC++ 6-141 (aka Visual Studio 2003-2015 and VCExpress9) are supported via calling devenv.
Msbuild as well as Windows Driver Kit 8 are supported via the MsBuild4, MsBuild12, MsBuild14 and MsBuild141 steps.
These steps will take care of setting up a clean compilation environment, parsing the generated output in real time, and delivering as detailed as possible information about the compilation executed.
All of the classes are in buildbot.steps.vstudio.
The available classes are:
VC6VC7VC8VC9VC10VC11VC12VC14VC141VS2003VS2005VS2008VS2010VS2012VS2013VS2015VS2017VS2019VS2022VCExpress9MsBuild4MsBuild12MsBuild14MsBuild141MsBuild15MsBuild16MsBuild17
The available constructor arguments are
modeThe mode default to
rebuild, which means that first all the remaining object files will be cleaned by the compiler. The alternate values arebuild, where only the updated files will be recompiled, andclean, where the current build files are removed and no compilation occurs.projectfileThis is a mandatory argument which specifies the project file to be used during the compilation.
configThis argument defaults to
releasean gives to the compiler the configuration to use.installdirThis is the place where the compiler is installed. The default value is compiler specific and is the default place where the compiler is installed.
useenvThis boolean parameter, defaulting to
Falseinstruct the compiler to use its own settings or the one defined through the environment variablesPATH,INCLUDE, andLIB. If any of theINCLUDEorLIBparameter is defined, this parameter automatically switches toTrue.PATHThis is a list of path to be added to the
PATHenvironment variable. The default value is the one defined in the compiler options.INCLUDEThis is a list of path where the compiler will first look for include files. Then comes the default paths defined in the compiler options.
LIBThis is a list of path where the compiler will first look for libraries. Then comes the default path defined in the compiler options.
archThat one is only available with the class VS2005 (VC8). It gives the target architecture of the built artifact. It defaults to
x86and does not apply toMsBuild4orMsBuild12. Please seeplatformbelow.projectThis gives the specific project to build from within a workspace. It defaults to building all projects. This is useful for building cmake generate projects.
platformThis is a mandatory argument for
MsBuild4andMsBuild12specifying the target platform such as ‘Win32’, ‘x64’ or ‘Vista Debug’. The last one is an example of driver targets that appear once Windows Driver Kit 8 is installed.definesThat one is only available with the MsBuild family of classes. It allows to define pre-processor constants used by the compiler.
Here is an example on how to drive compilation with Visual Studio 2013:
from buildbot.plugins import steps
f.addStep(
steps.VS2013(projectfile="project.sln", config="release",
arch="x64", mode="build",
INCLUDE=[r'C:\3rd-party\libmagic\include'],
LIB=[r'C:\3rd-party\libmagic\lib-x64']))
Here is a similar example using “MsBuild12”:
from buildbot.plugins import steps
# Build one project in Release mode for Win32
f.addStep(
steps.MsBuild12(projectfile="trunk.sln", config="Release", platform="Win32",
workdir="trunk",
project="tools\\protoc"))
# Build the entire solution in Debug mode for x64
f.addStep(
steps.MsBuild12(projectfile="trunk.sln", config='Debug', platform='x64',
workdir="trunk"))