Adding install option for vcpkg to solve compiling issues with cmake versions after 4.0#11904
Adding install option for vcpkg to solve compiling issues with cmake versions after 4.0#11904TomGoodIdea merged 10 commits intoendless-sky:masterfrom
Conversation
…versions after 4.0
|
Microsoft docs say that
I don't think this is what we want. |
|
I searched again and according to microsoft/vcpkg#45519 the problem with cmake has been resolved in newer versions of vcpkg. |
|
That can work if it still allows us to keep an old version of openal-soft. Have you tried also removing our existing CMake 4 workarounds from |
|
There are still v3.5 compatibility declarations in https://github.com/endless-sky/endless-sky/blob/master/CMakePresets.json |
|
I tested again with the new vcpkg. First, I deleted all instances of After that, vcpkg successfully installed all the packages, but OpenAL produced the following error after the installation was complete: After this, I re-added all the In the end, I successfully built both the debug and release versions of the game and tested them. |
|
Looks like a newer version of libxcrypt requires additional dependencies. You probably need to add them to the rest of installed dependencies in workflows files in |
|
I've tried to test this locally on Windows with CMake 4.0.1, and it fails, with vcpkg-manifest-install.log saying that it's unable to launch the Powershell it just downloaded. When I tried to manually run the pwsh.exe, it crashed with BEX64. |
|
I changed the vcpkg version to use the same powershell version as master. the vcpkg is just before they change the version of powershell. just before this PR microsoft/vcpkg#47326 |
TomGoodIdea
left a comment
There was a problem hiding this comment.
Looks good now. Thanks for working on this!
|
Thank you for your instant feedback. I’m glad to be of help. Love your works |
Bug Fix
This PR addresses the issue described in #11812.
Acknowledgement
Summary
Currently, several dependency libraries used for building the project specify
cmake_minimum_requiredversions lower than 3.5 in their CMake files. However, CMake versions 4.0 and later no longer allow this.As a result, when CMake 4.0 or newer is installed on a system, the project fails to build.
To resolve this, adding the
--x-abi-tools-use-exact-versionsflag to the vcpkg install command ensures that vcpkg uses the CMake version specified invcpkg/scripts/vcpkg-tools.json(which is currently 3.30.1).This issue and its solution are discussed here: microsoft/vcpkg#44784.
Testing Done
OS: Windows 10
Initially, I used
winlibs-x86_64-posix-seh-gcc-15.2.0-mingw-w64ucrt-13.0.0-r3, which includes CMake version 4.1.2, and encountered the same error as described in issue #11812.After applying the changes from this PR, the build used CMake version 3.30.1 instead, and the project successfully built and ran with my existing save file.