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
Map MinSizeRel and RelWithDebInfo correctly #6393
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the toolchain file, which will affect user projects' default setting (for example, a correct setup to use RelWithDebInfo for profiling, which only requires mapping specific packages in users' cmake files). For short, the fact that vcpkg doesn't provide RelWithDebInfo configuration doesn't imply that user's RelWithDebInfo configuration is broken, therefore this change is not acceptable to me.
@zhihaoy Short Answer: Think again. Long Answer:
It does because CMake will link the debug libraries provided by vcpkg in these cases. After reading those two: I will make a slight change to the PR because the value can actually be a list! |
Let me put it in this way: it breaks my company's build. The reason is that overwriting |
@zhihaoy Have you actually tested it with the latest commit? The PR is changed to:
so it should not change the mapping if MinSizeRel and RelWithDebInfo are available. |
Just tried (which triggered a full rebuild...), and it's worse than I thought. I used to think that it probably builds, but shows no symbol in profiler, but what I actually observed is:
And finally
From some Intel MKL lookup script. Exact reason needs more investigation, but you see the problem:
A per-target based remapping. |
all imported targets.
thats strange but you were probably wrongly relying on the debug configuration here for imported targets (that would be a hidden bug in your build). Symbols for normal targets should be visible. and this:
should not change anything expect for CMake to use Release instead of Debug in the case that a imported target does not provide MinSizeRel or RelWithDebInfo in IMPORTED_CONFIGURATIONS |
I see.
I haven't observed this because the executable doesn't built yet.
The current issue I saw is in a third-party script. |
So, although I don't know why, but here is the issue. This script https://github.com/arrayfire/arrayfire/blob/master/CMakeModules/FindMKL.cmake is configuration agnostic. It only sets |
Ah I see after rereading the doc your linker problem should be solved be adding an empty element to the list. |
@zhihaoy: my latest commit should take care of your linker problem with MKL. Please retry. The relevant section from the cmake docs:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, it works at least.
However, I will probably just set the two mappings in my project to silence the message if this change is merged, which comes to the next question: would it be better to document and recommend this setting?
I’d just remove the message, since it would appear for every build, even when not necessary. Am I right? |
It would require the file name to make sense out of it.
Side note: One could alternativly use |
@ras0219-msft @dan-shaw I'd like to share that we came to the same issues for ROS on Windows community. If someone uses I saw this pull request is attempting to fix this problem universally, which is good and I love to see it is moving forward. And I am also wondering, before the final solution is concluded, what's the recommended mitigation for who consuming |
@Neumann-A @seanyen Thanks for the feedback everyone. After some discussion, we've decided that it makes sense to merge this. After the MacOS CI pipeline is back up, I'll merge this. |
@Neumann-A I'm solving exactly this in my cmake build, I want to ask, why you set it like this:
and didn't also add
The same for:
I wonder if you had a good reason for that? Thank you for your clarification? 🙏 |
Unfortunately CMakes default is to map to debug.
To be more exact. It defaults to anything which is first in
CMAKE_CONFIGURATION_TYPES