From fb1b6c9d576955eba4ba6cc7da6862f60c431b8e Mon Sep 17 00:00:00 2001 From: Steven Keuchel Date: Tue, 12 Mar 2024 07:44:23 +0000 Subject: [PATCH] catch2_3: fix build on riscv and armv7l Co-authored-by: misuzu --- pkgs/development/libraries/catch2/3.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/catch2/3.nix b/pkgs/development/libraries/catch2/3.nix index 403c4f729b05..cf0a0bf70fc1 100644 --- a/pkgs/development/libraries/catch2/3.nix +++ b/pkgs/development/libraries/catch2/3.nix @@ -31,9 +31,12 @@ stdenv.mkDerivation rec { "-DCMAKE_CTEST_ARGUMENTS=-E;ApprovalTests" ]; - # Tests fail on x86_32 if compiled with x87 floats: https://github.com/catchorg/Catch2/issues/2796 env = lib.optionalAttrs stdenv.isx86_32 { + # Tests fail on x86_32 if compiled with x87 floats: https://github.com/catchorg/Catch2/issues/2796 NIX_CFLAGS_COMPILE = "-msse2 -mfpmath=sse"; + } // lib.optionalAttrs (stdenv.hostPlatform.isRiscV || stdenv.hostPlatform.isAarch32) { + # Build failure caused by -Werror: https://github.com/catchorg/Catch2/issues/2808 + NIX_CFLAGS_COMPILE = "-Wno-error=cast-align"; }; doCheck = true;