diff options
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/lib/cmake.nix | 8 | ||||
-rw-r--r-- | pkgs/build-support/lib/meson.nix | 38 |
2 files changed, 24 insertions, 22 deletions
diff --git a/pkgs/build-support/lib/cmake.nix b/pkgs/build-support/lib/cmake.nix index eff7bbca61a23..57fa586d34555 100644 --- a/pkgs/build-support/lib/cmake.nix +++ b/pkgs/build-support/lib/cmake.nix @@ -3,9 +3,8 @@ let inherit (lib) findFirst isString optional optionals; - makeCMakeFlags = { cmakeFlags ? [], ... }: - cmakeFlags - ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) ([ + cmakeFlags' = + optionals (stdenv.hostPlatform != stdenv.buildPlatform) ([ "-DCMAKE_SYSTEM_NAME=${findFirst isString "Generic" (optional (!stdenv.hostPlatform.isRedox) stdenv.hostPlatform.uname.system)}" ] ++ optionals (stdenv.hostPlatform.uname.processor != null) [ "-DCMAKE_SYSTEM_PROCESSOR=${stdenv.hostPlatform.uname.processor}" @@ -24,6 +23,9 @@ let ] ++ optionals stdenv.hostPlatform.isStatic [ "-DCMAKE_LINK_SEARCH_START_STATIC=ON" ]); + + makeCMakeFlags = { cmakeFlags ? [], ... }: cmakeFlags ++ cmakeFlags'; + in { inherit makeCMakeFlags; diff --git a/pkgs/build-support/lib/meson.nix b/pkgs/build-support/lib/meson.nix index 395b573f85876..456c10fcb8eeb 100644 --- a/pkgs/build-support/lib/meson.nix +++ b/pkgs/build-support/lib/meson.nix @@ -9,25 +9,25 @@ let else if isx86_32 then "x86" else platform.uname.processor; - makeMesonFlags = { mesonFlags ? [], ... }: - let - crossFile = builtins.toFile "cross-file.conf" '' - [properties] - bindgen_clang_arguments = ['-target', '${stdenv.targetPlatform.config}'] - needs_exe_wrapper = ${boolToString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform)} - - [host_machine] - system = '${stdenv.targetPlatform.parsed.kernel.name}' - cpu_family = '${cpuFamily stdenv.targetPlatform}' - cpu = '${stdenv.targetPlatform.parsed.cpu.name}' - endian = ${if stdenv.targetPlatform.isLittleEndian then "'little'" else "'big'"} - - [binaries] - llvm-config = 'llvm-config-native' - rust = ['rustc', '--target', '${stdenv.targetPlatform.rust.rustcTargetSpec}'] - ''; - crossFlags = optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "--cross-file=${crossFile}" ]; - in crossFlags ++ mesonFlags; + crossFile = builtins.toFile "cross-file.conf" '' + [properties] + bindgen_clang_arguments = ['-target', '${stdenv.targetPlatform.config}'] + needs_exe_wrapper = ${boolToString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform)} + + [host_machine] + system = '${stdenv.targetPlatform.parsed.kernel.name}' + cpu_family = '${cpuFamily stdenv.targetPlatform}' + cpu = '${stdenv.targetPlatform.parsed.cpu.name}' + endian = ${if stdenv.targetPlatform.isLittleEndian then "'little'" else "'big'"} + + [binaries] + llvm-config = 'llvm-config-native' + rust = ['rustc', '--target', '${stdenv.targetPlatform.rust.rustcTargetSpec}'] + ''; + + crossFlags = optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "--cross-file=${crossFile}" ]; + + makeMesonFlags = { mesonFlags ? [], ... }: crossFlags ++ mesonFlags; in { |