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>
This commit is contained in:
parent
875d77ca03
commit
4dbf8f6915
1 changed files with 9 additions and 4 deletions
|
@ -23,16 +23,21 @@ stdenv.mkDerivation rec {
|
|||
|
||||
nativeBuildInputs = [ cmake ninja ];
|
||||
|
||||
checkInputs = [ gtest ];
|
||||
|
||||
# Required for case-insensitive filesystems ("BUILD" exists)
|
||||
dontUseCmakeBuildDir = true;
|
||||
|
||||
cmakeFlags = [
|
||||
cmakeFlags = let
|
||||
libExt = stdenv.hostPlatform.extensions.library;
|
||||
in [
|
||||
"-GNinja"
|
||||
"-DCMAKE_INSTALL_LIBDIR=lib"
|
||||
"-DCMAKE_INSTALL_INCLUDEDIR=include"
|
||||
] ++ lib.optional doCheck "-DHWY_SYSTEM_GTEST:BOOL=ON";
|
||||
] ++ lib.optionals doCheck [
|
||||
"-DHWY_SYSTEM_GTEST:BOOL=ON"
|
||||
"-DGTEST_INCLUDE_DIR=${lib.getDev gtest}/include"
|
||||
"-DGTEST_LIBRARY=${lib.getLib gtest}/lib/libgtest${libExt}"
|
||||
"-DGTEST_MAIN_LIBRARY=${lib.getLib gtest}/lib/libgtest_main${libExt}"
|
||||
];
|
||||
|
||||
# hydra's darwin machines run into https://github.com/libjxl/libjxl/issues/408
|
||||
doCheck = !stdenv.hostPlatform.isDarwin;
|
||||
|
|
Loading…
Reference in a new issue