build-support/lib/cmake: Statically compute default cmake flags

+5 -3
+5 -3
pkgs/build-support/lib/cmake.nix
··· 3 3 let 4 4 inherit (lib) findFirst isString optional optionals; 5 5 6 - makeCMakeFlags = { cmakeFlags ? [], ... }: 7 - cmakeFlags 8 - ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) ([ 6 + cmakeFlags' = 7 + optionals (stdenv.hostPlatform != stdenv.buildPlatform) ([ 9 8 "-DCMAKE_SYSTEM_NAME=${findFirst isString "Generic" (optional (!stdenv.hostPlatform.isRedox) stdenv.hostPlatform.uname.system)}" 10 9 ] ++ optionals (stdenv.hostPlatform.uname.processor != null) [ 11 10 "-DCMAKE_SYSTEM_PROCESSOR=${stdenv.hostPlatform.uname.processor}" ··· 24 23 ] ++ optionals stdenv.hostPlatform.isStatic [ 25 24 "-DCMAKE_LINK_SEARCH_START_STATIC=ON" 26 25 ]); 26 + 27 + makeCMakeFlags = { cmakeFlags ? [], ... }: cmakeFlags ++ cmakeFlags'; 28 + 27 29 in 28 30 { 29 31 inherit makeCMakeFlags;