Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msbuild generator custom configs #8014

Conversation

memsharded
Copy link
Member

@memsharded memsharded commented Nov 5, 2020

Changelog: Feature: Allow (experimental) custom configuration of the msbuild generator.
Changelog: Feature: Rename msbuild generator to MSBuildDeps and use the new generate() method.
Docs: conan-io/docs#1952

Simplified from https://github.com/conan-io/conan/pull/7754/files

This is ONLY the msbuild part. There are 2 external things to be addressed too, but lets discuss those in other issues:

  • The import structure for tools, helpers, etc.
  • The config mechanism to propagate things from config and command line to the recipes and codebase.

#tags: slow

@memsharded memsharded added this to the 1.32 milestone Nov 5, 2020
Copy link
Contributor

@jgsogo jgsogo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some changes/suggestiongs, and main comment: IMO, we should remove the config_filename, it adds a degree of freedom that is not needed and it can be misleading because it is not considered in the condition:

def toolchain(self):
   ms = MSBuildDeps(self)
   ms.configuration = "My"+str(self.settings.build_type)
   ms.platform = "My"+str(self.settings.arch)
   ms.config_filename = 'optTrue' if self.options.opt1 else 'optFalse'
   ms.generate()

We get two different files, but we cannot reach one of them, which one? It depends on the install order...

conan/tools/cmake/base.py Outdated Show resolved Hide resolved
conan/tools/cmake/base.py Outdated Show resolved Hide resolved
conans/client/conanfile/configure.py Outdated Show resolved Hide resolved
conans/client/generators/__init__.py Outdated Show resolved Hide resolved
conans/client/generators/__init__.py Outdated Show resolved Hide resolved
conans/test/functional/toolchain/test_txt_cmdline.py Outdated Show resolved Hide resolved
conan/tools/microsoft/msbuilddeps.py Outdated Show resolved Hide resolved
conans/client/generators/__init__.py Show resolved Hide resolved
Copy link
Contributor

@jgsogo jgsogo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of comments

conan/tools/microsoft/msbuilddeps.py Show resolved Hide resolved
conan/tools/microsoft/msbuilddeps.py Show resolved Hide resolved
@memsharded memsharded merged commit 8c02cca into conan-io:develop Dec 1, 2020
2 checks passed
@memsharded memsharded deleted the feature/generator_msbuild_custom_configs branch December 1, 2020 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants