[vcpkg] Add mapping for the None config#35940
Conversation
|
Did you provide an empty overlay for fmt? |
|
I did not provide an empty overlay for fmt, my goal here is to make it possible to import a system library not installed in vcpkg. The issue is that just using vcpkg's toolchain (without installing anything) is enough to break find_package for system libraries in those configurations. None is not mentioned in the CMake documentation but is the de facto standard (especially used by Linux distributions) to try to conform as close as possible to specified CFLAGS and CXXFLAGS. I think adding it as a fallback here make sense, for the same reason we currently have an empty string fallback. It's better to get the |
Not providing an (empty) overlay for system deps like this already goes against the philosophy of vcpkg.
Doesn't make sense. You could just leave the build type empty in these cases. You are basically requesting something here which already fails outside of vcpkg with only CMake.
The custom configs just add
I see you don't understand the mapping at all. The mapping is for targets which setup |
I want vcpkg to handle what it can and fallback to system libraries for others.
There is ample documentation explaining why it is done, see here for Debian and here for Arch Linux. As I said, it allows to conform as close as possible to the CFLAGS and CXXFLAGS that the distributions try to enforce because it blocks the defaulting of the build type that quite a few libraries have.
This is wrong. As I mentioned in my first comment CMake will fallback to any available configuration for the imported target if the mapping variable is not explicitly defined. However vcpkg's toolchain will set this variable if not present and therefore break an otherwise working find_package on a default Debian installation. I'm not trying to argue whether things should have been done differently, but this tiny patch will help compatibility with the most popular Linux distributions out there and without any drawbacks. |
|
IIRC
And Kitware seems to agree that It is similar to the vcpkg situation, but only for a single configuration where vcpkg must support two. |
|
@BillyONeal, could you please help take a review? thanks. |
|
Regarding:
@ras0219-msft "If without vcpkg's edits, it would have been found, then it makes sense to add this so that they are still found." The reason that we edit |
|
@BillyONeal This will just add precedent case for all custom configuration following that argument. It would be better if upstream CMake would have a pattern rule for configuration mapping or an |
This is a good idea. Please feel free to open an issue on CMake upstream, but until this is implemented in the CMake versions most commonly found vcpkg should still strive for full compatibility with all Debian (and Arch) based distributions. |
BillyONeal
left a comment
There was a problem hiding this comment.
This LGTM but I would like @ras0219-msft on record as also OKing it.
vcpkg's toolchain currently breaks find_package of CMake libraries on Debian with
MinSizeRelorRelWithDebInfoconfigs. For example I can't import the version offmtinstalled by apt.This is caused by the explicit config mapping which disables the automatic fallback1 to any other configuration and the fact that Debian explicitly sets
CMAKE_BUILD_TYPEtoNonewhen building packages2.Footnotes
https://cmake.org/cmake/help/latest/prop_tgt/IMPORTED_LOCATION.html ↩
https://salsa.debian.org/debian/debhelper/-/blob/fedaeeb9a61d2622c134c028d2b02fdb286a8636/lib/Debian/Debhelper/Buildsystem/cmake.pm#L16 ↩