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

This commit is contained in:
adisbladis 2024-03-20 13:45:45 +13:00
parent 5ef1bd952c
commit 085c172348

View File

@ -9,8 +9,6 @@ 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}']
@ -26,8 +24,10 @@ let
llvm-config = 'llvm-config-native'
rust = ['rustc', '--target', '${stdenv.targetPlatform.rust.rustcTargetSpec}']
'';
crossFlags = optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "--cross-file=${crossFile}" ];
in crossFlags ++ mesonFlags;
makeMesonFlags = { mesonFlags ? [], ... }: crossFlags ++ mesonFlags;
in
{