Repository navigation
[cmake-user] Test multi-config cmake usage - #27408
Kai Pastor (dg0yt) wants to merge 12 commits into
Conversation
|
Example output,
|
|
Multi config will always be a bit buggy because of vendored/custom |
I don't care much about vendored copies. All the tests in Results from CI, x64-windows release |
0700676 to
f5dfa3b
Compare
There was a problem hiding this comment.
You have modified or added at least one portfile where deprecated functions are used.
Details
If you feel able to do so, please consider migrating them to the new functions:
vcpkg_install_cmake -> vcpkg_cmake_install (from port vcpkg-cmake)
vcpkg_build_cmake -> vcpkg_cmake_build (from port vcpkg-cmake)
vcpkg_configure_cmake -> vcpkg_cmake_configure (Please remove the option PREFER_NINJA) (from port vcpkg-cmake)
vcpkg_fixup_cmake_targets -> vcpkg_cmake_config_fixup (from port vcpkg-cmake-config)
vcpkg_extract_source_archive_ex -> vcpkg_extract_source_archive
vcpkg_build_msbuild -> vcpkg_install_msbuild
vcpkg_copy_tool_dependencies -> vcpkg_copy_tools
vcpkg_apply_patches should be replaced by the PATCHES arguments to the "extract" helpers (e.g. vcpkg_from_github())
In the ports that use the new function, you have to add the corresponding dependencies:
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}The following files are affected:
scripts/test_ports/cmake-user/portfile.cmake
|
Closing this PR because it's been in draft without changes for more than a year. Please feel free to recreate or reopen! |
|
Cannot reopen... |
If you want to reopen this PR, please ping us anytime. Do you want to reopen this PR now? |
|
yes |
|
Hmm... reopening a PR shouldn't require permissions |
It does, in this repo. And we are complaining almost every time. |
| endif() | ||
|
|
||
| message(STATUS "CMAKE_GENERATOR: ${CMAKE_GENERATOR}") | ||
| if(CMAKE_GENERATOR MATCHES "Multi-Config|Visual Studio") |
There was a problem hiding this comment.
I've been hitting this issue with xcode, which I think this check would miss - Perhaps can use the GENERATOR_IS_MULTI_CONFIG property instead?
There was a problem hiding this comment.
Makes sense.
(IIRC the actual problem with this PR was/is how many official Find modules did/do not support vcpkg's multiconfig installation layout.)
There was a problem hiding this comment.
Changed. But the test port controls the generator, together with additional options.
There was a problem hiding this comment.
🟡 Changes recommended
Generator selection breaks CMake 3.16 tests, and the build arguments do not exercise the intended default-versus-active configuration mismatch.
2 open issues
What changed in this PR
Extends the cmake-user test port to check multi-configuration CMake usage, targeting configuration-specific library selection regressions such as #26833 and the fix in #27369.
Changes:
- Selects Ninja Multi-Config for dual-configuration triplets and passes explicit configurations to package builds.
- Adds generator diagnostics and checks for unguarded Debug or Release library paths.
Validation was limited to source inspection; no builds were run.
| File | Description |
|---|---|
| scripts/test_ports/cmake-user/project/CMakeLists.txt | Adds configuration diagnostics and multi-config library checks. |
| scripts/test_ports/cmake-user/portfile.cmake | Selects generators and supplies configuration-specific build arguments. |
Review effort: Balanced
|
Testing single-config for CMake 3.16 and for single-config (CI: x64-windows-release). Considering MSVS and XCode as regular multi-config consumers. For x64-windows multi-config, the failing packages are:
For arm64-osx multi-config, the failing packages are:
|


What does your PR fix?
Extends port
cmake-userto cover usage with multi-config.Confirms [giflib] Debug library linked in release configuration #26833. Validates [giflib] Fix multi-config
find_package(GIF)#27369.Which triplets are supported/not supported? Have you updated the CI baseline?
unchanged, no
Does your PR follow the maintainer guide?
yes
If you have added/updated a port: Have you run
./vcpkg x-add-version --alland committed the result?I am still working on this PR.