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

[question] How to set extra MSBuild properties in the MSBuildToolchain? #12142

Closed
1 task done
jellespijker opened this issue Sep 19, 2022 · 2 comments · Fixed by #12147
Closed
1 task done

[question] How to set extra MSBuild properties in the MSBuildToolchain? #12142

jellespijker opened this issue Sep 19, 2022 · 2 comments · Fixed by #12147
Milestone

Comments

@jellespijker
Copy link
Contributor

I'm trying to modernize the cpython recipe in CCI that means porting to the MSbuild, MSBuildDeps and MSBuildToolchain generators. The current recipe passes an additional property "IncludeExternals": "true" https://github.com/conan-io/conan-center-index/blob/f85db3e60973cb076e694a1264946e29e82e66c5/recipes/cpython/all/conanfile.py#L395 to the build command; translating into an extra argument /p:IncludeExternals="true". There is an open FR which asks for allowing extra compiler flags to be passed #7653 but I can't seem to figure out how to set extra properties such at these, in the Toolchain. What is the preferred method to do so?

Current state of the PR conan-io/conan-center-index#12470

@czoido
Copy link
Contributor

czoido commented Sep 19, 2022

Hi @jellespijker,

The current implementation of the MSBuildToolchain does not allow adding custom properties that can later be passed to the build system like other integrations do. I think we can mark this for the 1.53 to be added as a feature or at least to consider it. Thanks a lot for the reporting.

@czoido czoido added this to the 1.53 milestone Sep 19, 2022
@jellespijker
Copy link
Contributor Author

Great thx.

In the meantime I will just patch the Directory.Build.props

replace_in_file(self, self.source_path.joinpath("PCbuild", "Directory.Build.props"), "</Project>",
                textwrap.dedent(f"""  <PropertyGroup>
                                        <IncludeExternals>true</IncludeExternals>
                                        <PlatformToolset>{msvc_version_to_toolset_version(self.settings.compiler.version)}</PlatformToolset>
                                      </PropertyGroup>
                                    </Project>"""), runtime_library)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants