Skip to content

Commit db7acb3

Browse files
committed
ci: Fix shell.nix compatibility with CMake 4.0
CMake 4.0 dropped support for older policies, so versions of Cap'n Proto <= v1.1.0 (before capnproto/capnproto#2272) require an additional option to build with CMake 4.0. Without this change, there are errors like: > CMake Error at CMakeLists.txt:1 (cmake_minimum_required): > Compatibility with CMake < 3.5 has been removed from CMake. > > Update the VERSION argument <min> value. Or, use the <min>...<max> syntax > to tell CMake that the project requires at least <min> but has been updated > to work with policies introduced by <max> or earlier. > > Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway. This change fixes the problem by specifying -DCMAKE_POLICY_VERSION_MINIMUM=3.5 when needed.
1 parent 91a7759 commit db7acb3

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

shell.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ let
3939
hash = lib.attrByPath [capnprotoVersion] "" capnprotoHashes;
4040
};
4141
patches = lib.optionals (lib.versionAtLeast capnprotoVersion "0.9.0" && lib.versionOlder capnprotoVersion "0.10.4") [ ./ci/patches/spaceship.patch ];
42+
cmakeFlags = (old.cmakeFlags or []) ++ (lib.optionals (lib.versionAtLeast "1.1.0" capnprotoVersion) ["-DCMAKE_POLICY_VERSION_MINIMUM=3.5"]);
4243
} // (lib.optionalAttrs (lib.versionOlder capnprotoVersion "0.10") {
4344
env = { }; # Drop -std=c++20 flag forced by nixpkgs
4445
}));

0 commit comments

Comments
 (0)