rapidjson: build with C++17 language level

gtest was upgraded to 1.14.0; as of 1.13.x gtest requires at least c++14
to build.

rapidjson's CMake scripts have support for specifying C++11 or C++17;
rather than add our own support for C++14 we set the C++17 flag instead.
This commit is contained in:
Luke Granger-Brown 2024-02-20 19:49:58 +00:00
parent 999dc2b653
commit 5cafc420e3

View File

@ -43,7 +43,14 @@ stdenv.mkDerivation rec {
# for tests, adding gtest to checkInputs does not work
# https://github.com/NixOS/nixpkgs/pull/212200
buildInputs = [ gtest ];
cmakeFlags = [ "-DGTEST_SOURCE_DIR=${gtest.dev}/include" ];
cmakeFlags = [
"-DGTEST_SOURCE_DIR=${gtest.dev}/include"
# Build rapidjson with std=c++17 so gtest 1.13.0+ works
# https://github.com/NixOS/nixpkgs/pull/282245#issuecomment-1951796902
"-DRAPIDJSON_BUILD_CXX11=OFF"
"-DRAPIDJSON_BUILD_CXX17=ON"
];
nativeCheckInputs = [ valgrind ];
doCheck = !stdenv.hostPlatform.isStatic && !stdenv.isDarwin;