Update deprecated cmake version #2311
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As discussed in #2310, there are some issues with the build system picking a linker for unikernels, even in
--puremode.Passing
set(CMAKE_LINKER_TYPE LLD)seems to fix this, but doesn't work in older versions of CMake. This PR updates the minimum version of cmake we depend on to 3.31.6 (as reported bynix-shell --pure ./develop.nix --run 'cmake --version').Bumping this version reports two usages of
PRE_BUILDwhich is invalid in modern CMake (I believe they always have been, but just been silently ignored? https://cmake.org/cmake/help/latest/command/add_custom_command.html), and only be relevant to the Visual Studio editor and build system. I've simply removed them (commit 7097eda).Lastly, I have added an explicit dependency to LLD/LLVM (https://cmake.org/cmake/help/latest/variable/CMAKE_LINKER_TYPE.html) in the example unikernel. With CMake updated, the unikernel links successfully even on Gentoo .