Merge pull request #186559 from NickCao/rapidjson
rapidjson: fix cross compilation, cleanup checkPhase
This commit is contained in:
commit
0a216732d8
1 changed files with 6 additions and 17 deletions
|
@ -5,6 +5,7 @@
|
||||||
, pkg-config
|
, pkg-config
|
||||||
, cmake
|
, cmake
|
||||||
, gtest
|
, gtest
|
||||||
|
, valgrind
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
|
@ -36,24 +37,12 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
nativeBuildInputs = [ pkg-config cmake ];
|
nativeBuildInputs = [ pkg-config cmake ];
|
||||||
|
|
||||||
cmakeFlags = [
|
# for tests, adding gtest to checkInputs does not work
|
||||||
"-DGTEST_SOURCE_DIR=${gtest.dev}/include"
|
# https://github.com/NixOS/nixpkgs/pull/212200
|
||||||
] ++ lib.optionals (!doCheck) [
|
buildInputs = [ gtest ];
|
||||||
"-DRAPIDJSON_BUILD_TESTS=OFF"
|
cmakeFlags = [ "-DGTEST_SOURCE_DIR=${gtest.dev}/include" ];
|
||||||
];
|
|
||||||
|
|
||||||
nativeCheckInputs = [
|
|
||||||
gtest
|
|
||||||
];
|
|
||||||
|
|
||||||
checkPhase = ''
|
|
||||||
runHook preCheck
|
|
||||||
|
|
||||||
ctest -E '.*valgrind.*'
|
|
||||||
|
|
||||||
runHook postCheck
|
|
||||||
'';
|
|
||||||
|
|
||||||
|
nativeCheckInputs = [ valgrind ];
|
||||||
doCheck = !stdenv.hostPlatform.isStatic;
|
doCheck = !stdenv.hostPlatform.isStatic;
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
|
|
Loading…
Reference in a new issue