From b6c05bc36720113f59d6a4f232f29189d4f80220 Mon Sep 17 00:00:00 2001 From: Ben Wolsieffer Date: Thu, 14 Sep 2023 22:03:06 -0400 Subject: [PATCH] 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. --- pkgs/development/libraries/spdlog/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/spdlog/default.nix b/pkgs/development/libraries/spdlog/default.nix index d68e22f1c891..ff42a5ba3b5c 100644 --- a/pkgs/development/libraries/spdlog/default.nix +++ b/pkgs/development/libraries/spdlog/default.nix @@ -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"}"