diff --git a/reference/tools/microsoft/msbuild.rst b/reference/tools/microsoft/msbuild.rst index 5862382a50c..7f34fa98348 100644 --- a/reference/tools/microsoft/msbuild.rst +++ b/reference/tools/microsoft/msbuild.rst @@ -26,19 +26,44 @@ The ``MSBuild.build()`` method internally implements a call to ``msbuild`` like: .. code:: bash - $ && msbuild "MyProject.sln" /p:Configuration= /p:Platform= + $ && msbuild "MyProject.sln" /p:Configuration= /p:Platform= Where: - ```` calls the Visual Studio prompt that matches the current recipe ``settings``. -- ```` is the configuration, typically ``Release``, or ``Debug``, which is obtained from ``settings.build_type``, - but this is configurable. +- ``configuration``, typically Release, Debug, which will be obtained from ``settings.build_type`` + but this can be customized with the ``build_type`` attribute. - ```` is the architecture, a mapping from the ``settings.arch`` to the common 'x86', 'x64', 'ARM', 'ARM64'. + This can be customized with the ``platform`` attribute. Customization --------------- +attributes +++++++++++ + +You can customize the following attributes in case you need to change them: + +- **build_type** (default ``settings.build_type``): Value for the ``/p:Configuration``. +- **platform** (default based on ``settings.arch`` to select one of these values: (``'x86', 'x64', 'ARM', 'ARM64'``): + Value for the ``/p:Platform``. + +Example: + +.. code:: python + + from conan import ConanFile + from conan.tools.microsoft import MSBuild + class App(ConanFile): + settings = "os", "arch", "compiler", "build_type" + def build(self): + msbuild = MSBuild(self) + msbuild.build_type = "MyRelease" + msbuild.platform = "MyPlatform" + msbuild.build("MyProject.sln") + + conf ++++