spdlog: fix cross-compilation

Currently, catch2 is listed in checkInputs, which means it is not available
when cross-compiling. On the other hand, -DSPDLOG_BUILD_TESTS=ON is passed
unconditionally, causing the build to fail when cross-compiling. This can be
fixed either by moving catch2 to buildInputs or by only building the tests
when doCheck is true. This patch implements the former solution, so the tests
are always built even if they cannot be run.
This commit is contained in:
Ben Wolsieffer 2023-09-14 22:03:06 -04:00
parent 4b790413b4
commit b6c05bc367

View file

@ -31,8 +31,9 @@ stdenv.mkDerivation rec {
];
nativeBuildInputs = [ cmake ];
# Required to build tests, even if they aren't executed
buildInputs = [ catch2_3 ];
propagatedBuildInputs = [ fmt ];
checkInputs = [ catch2_3 ];
cmakeFlags = [
"-DSPDLOG_BUILD_SHARED=${if staticBuild then "OFF" else "ON"}"