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

Fix RuntimeLibrary deduced from profile in MSBuildToolchain #17100

Merged

Conversation

SpaceIm
Copy link
Contributor

@SpaceIm SpaceIm commented Oct 1, 2024

Changelog: Fix: Properly deduce RuntimeLibrary from profile in MSBuildToolchain.
Docs: Omit

closes #17099

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the develop branch, documenting this one.

- take into account compiler.runtime_type instead of build_type (and fallback to build_type only if runtime_type is not set)
- properly compute runtime_library regardless of compiler (logic was broken for clang-cl for exemple)
Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

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

Hi @SpaceIm

Many thanks for your contribution.

It would be necessary to add some tests that covers it, I think it is enough to add some integration tests that checks the resulting toolchain.props file result.

This diff is actually changing 2 different things, and both should be covered by tests:

  • The runtime_type that is not being honored, which I agree it looks like a gap to solve
  • The fact that only msvc and intel-cc define runtime=static/dynamic, which means that other compilers were not adding a runtime library, because MT/MD are no longer valid compiler.runtime values in the default settings. This also looks like a gap, but it would be important to explicitly acknowledge it in the tests, making sure that it is fine for clang compiler toolset in MSVC to add the <RuntimeLibrary>

@SpaceIm
Copy link
Contributor Author

SpaceIm commented Oct 3, 2024

I agree. I'll try to implement several tests.

@SpaceIm
Copy link
Contributor Author

SpaceIm commented Oct 12, 2024

I've extended integration tests in order to cover runtime_type in MSBuildToolchain.
Regarding ClangCL, it requires more work since I have also to rethink the tests since integration test of MSBuildToolchain also checks PlatformToolset (more complicated with ClangCL, since there is also an extra setting runtime_version), and it's out of scope of this PR.

@memsharded
Copy link
Member

Thanks for adding the test and your contribution!

@memsharded memsharded merged commit 2aa8e08 into conan-io:develop2 Oct 14, 2024
2 checks passed
@memsharded memsharded added this to the 2.9.0 milestone Oct 14, 2024
@SpaceIm SpaceIm deleted the feat/fix-runtime-library-msbuildtoolchain branch October 14, 2024 11:43
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.

[bug] MSBuildToolchain doesn't honor compiler.runtime_type
2 participants