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
[vcpkg_copy_tool_dependencies] Switch to cmake function file(GET_RUNTIME_DEPENDENCIES) #26585
[vcpkg_copy_tool_dependencies] Switch to cmake function file(GET_RUNTIME_DEPENDENCIES) #26585
Conversation
…IME_DEPENDENCIES)
find_program(Z_VCPKG_POWERSHELL_CORE pwsh) | ||
if (NOT Z_VCPKG_POWERSHELL_CORE) | ||
message(FATAL_ERROR "Could not find PowerShell Core; please open an issue to report this.") | ||
if (CMAKE_MAJOR_VERSION VERSION_LESS 3 OR CMAKE_MINOR_VERSION VERSION_LESS 16) |
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.
broken with eventual cmake 4.0
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.
There should be no need to test the individual version components separately. Operators like VERSION_LESS
handle full version numbers:
if (CMAKE_MAJOR_VERSION VERSION_LESS 3 OR CMAKE_MINOR_VERSION VERSION_LESS 16) | |
if(CMAKE_VERSION VERSION_LESS 3.16) |
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.
CMAKE_VERSION
is only exists in and after cmake 2.6.3, see https://cmake.org/cmake/help/latest/variable/CMAKE_VERSION.html
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.
are we supporting such an old CMake version in downstream projects? I don't think so!
also this script runs in internal cmake, which means we can use the latest and greatest, right?
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.
are we supporting such an old CMake version in downstream projects? I don't think so! also this script runs in internal cmake, which means we can use the latest and greatest, right?
Good question! Therefore, we must choose one of the following ways:
- Always use cmake from vcpkg, which will go against
VCPKG_FORCE_BINARIES
. - Keep the original code and enable the new code when the current cmake version is higher than the version that can support this feature.
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.
Currently, we are working on directly incorporating this function into vcpkg-tool, including parsing PE, elf and mach-O formats.
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.
Good question!
No, it was a rhetorical question. vcpkg requires at least CMake 3.7 in user projects, and script may rely on the version which is downloaded by vcpkg.
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.
Currently stuck at upstream issue: https://gitlab.kitware.com/cmake/cmake/-/issues/23906 |
Currently,
vcpkg_copy_tool_dependencies
calls the ps1 scriptapplocal.ps1
on Windows to perform the function of analyzing dependencies and copying dependencies, which is affected by the powershell version and the Visual Studio English language package.Switch to cmake functions to avoid these issues.
Related official document: https://cmake.org/cmake/help/latest/command/file.html#get-runtime-dependencies
Resolve: #17448 #17890 #16721 #14339 #10619 #12849