[z_vcpkg_setup_pkgconfig_path] debug needs `share/pkgconfig`
Pass share/pkgconfig instead of debug/share/pkgconfig: The share location is for config-independent data.
Integrate CURRENT_PACKAGES_DIR locations.
Change the function interface to take a CONFIG parameter instead of prefix list (suggested below).
Use z_vcpkg_setup_pkgconfig_path also for vcpkg_fixup_pkgconfig (which already had proper handling of CURRENT_PACKAGES_DIR and share).
Remove redundant trailing slash.
Extend unit test.
Fixes consuming wayland-protocols and similar.
Fixes consuming
wayland-protocolsand similar.
Sorry for being thick headed on this, what do you mean by this?
Answering both questions at once:
- While playing with
mesaon linux, I forced the installation ofwayland-protocolsvia the port instead of via the system. -
wayland-protocolsinstalls/share/pkgconfig/wayland-protocols.pc. - For the debug build of
mesa,z_vcpkg_setup_pkgconfig_pathis called withBASE_DIRS "${CURRENT_INSTALLED_DIR}/debug". - So the function used to add
${CURRENT_INSTALLED_DIR}/debug/share/pkgconfig. This location doesn't exist, andwayland-protocols.pcwas not found. - With this PR, this particular invalid path is mapped to the known good path. The path must be added. There can't be
continue, because this would still preventwayland-protocolsfrom being found.
BTW, the function prepends, i.e. in the case of multiple base dirs, they would end up in reverse order. I didn't fix it because it didn't want to to discuss it...
- For the debug build of
mesa,z_vcpkg_setup_pkgconfig_pathis called withBASE_DIRS "${CURRENT_INSTALLED_DIR}/debug".
Why don't we fix that rather than trying to second guess what the caller said?
- For the debug build of
mesa,z_vcpkg_setup_pkgconfig_pathis called withBASE_DIRS "${CURRENT_INSTALLED_DIR}/debug".Why don't we fix that rather than trying to second guess what the caller said?
The caller does it right, it doesn't need to be fixed.
However, with vcpkg's atypical installation layout mapping debug/share to share, ${CURRENT_INSTALLED_DIR}/share/pkgconfig is the actual implementation of ${CURRENT_INSTALLED_DIR}/debug/share/pkgconfig, and the substitution of this special value in the single called function is the appropriate solution, not changing the indeterminate number of callers.
the substitution of this special value in the single called function is the appropriate solution, not changing the indeterminate number of callers.
I kind of disagree with that. If callers aren't passing a value, and we are supplying default values, then sure, party hard. But callers are not doing that, they asked for a specific value, and a function shouldn't be lying to the caller.
with vcpkg's atypical installation layout mapping debug/share to share,
If vcpkg is doing something funny with where the .pcs are located in a funny place, why aren't we changing the other place in vcpkg calling the x_'d function to do the right thing?
There are exactly 2 callers doing:
if ("${current_buildtype}" STREQUAL "DEBUG")
z_vcpkg_setup_pkgconfig_path(BASE_DIRS "${CURRENT_INSTALLED_DIR}/debug")
else()
z_vcpkg_setup_pkgconfig_path(BASE_DIRS "${CURRENT_INSTALLED_DIR}")
endif()
one of which is vcpkg_configure_make and the other of which is vcpkg_configure_meson. I think the right fix is to change that block in both of those to just
z_vcpkg_setup_pkgconfig_path(BASE_DIRS "${CURRENT_INSTALLED_DIR}")
The caller does it right, it doesn't need to be fixed.
I'm confused by this statement. Isn't this change undoing what vcpkg_configure_make and vcpkg_configure_meson are trying to do?
I'm confused by this statement. Isn't this change undoing what vcpkg_configure_make and vcpkg_configure_meson are trying to do?
No the idea is that /share/pkgconfig/ is independent on configuration. As such it should always be in CURRENT_INSTALLED_DIR/share/pkgconfig. This also applies to CURRENT_PACKAGES_DIR which this PR does not fix.
And yes z_vcpkg_setup_pkgconfig_path(BASE_DIRS "${CURRENT_INSTALLED_DIR}") is terrible. It should have been z_vcpkg_setup_pkgconfig_path(CONFIG <config>) and abstracted away passing in any paths at all.
And yes
z_vcpkg_setup_pkgconfig_path(BASE_DIRS "${CURRENT_INSTALLED_DIR}")is terrible. It should have beenz_vcpkg_setup_pkgconfig_path(CONFIG <config>)and abstracted away passing in any paths at all.
This is a z_ thing so that change can be made.
Ping for review @BillyONeal.
@Neumann-A Are you happy with this?