lol

libhwy: fix tests when cross-compiling

It seems to need some help to find gtest when cross compiling.

(Only applies when cross-compiling to compatible architectures where
the tests are enabled, like pkgsStatic.)

Co-authored-by: Daniel Olsen <daniel.olsen99@gmail.com>

+9 -4
+9 -4
pkgs/development/libraries/libhwy/default.nix
··· 23 24 nativeBuildInputs = [ cmake ninja ]; 25 26 - checkInputs = [ gtest ]; 27 - 28 # Required for case-insensitive filesystems ("BUILD" exists) 29 dontUseCmakeBuildDir = true; 30 31 - cmakeFlags = [ 32 "-GNinja" 33 "-DCMAKE_INSTALL_LIBDIR=lib" 34 "-DCMAKE_INSTALL_INCLUDEDIR=include" 35 - ] ++ lib.optional doCheck "-DHWY_SYSTEM_GTEST:BOOL=ON"; 36 37 # hydra's darwin machines run into https://github.com/libjxl/libjxl/issues/408 38 doCheck = !stdenv.hostPlatform.isDarwin;
··· 23 24 nativeBuildInputs = [ cmake ninja ]; 25 26 # Required for case-insensitive filesystems ("BUILD" exists) 27 dontUseCmakeBuildDir = true; 28 29 + cmakeFlags = let 30 + libExt = stdenv.hostPlatform.extensions.library; 31 + in [ 32 "-GNinja" 33 "-DCMAKE_INSTALL_LIBDIR=lib" 34 "-DCMAKE_INSTALL_INCLUDEDIR=include" 35 + ] ++ lib.optionals doCheck [ 36 + "-DHWY_SYSTEM_GTEST:BOOL=ON" 37 + "-DGTEST_INCLUDE_DIR=${lib.getDev gtest}/include" 38 + "-DGTEST_LIBRARY=${lib.getLib gtest}/lib/libgtest${libExt}" 39 + "-DGTEST_MAIN_LIBRARY=${lib.getLib gtest}/lib/libgtest_main${libExt}" 40 + ]; 41 42 # hydra's darwin machines run into https://github.com/libjxl/libjxl/issues/408 43 doCheck = !stdenv.hostPlatform.isDarwin;