build-support/lib/meson: Statically compute default meson flags
This commit is contained in:
parent
5ef1bd952c
commit
085c172348
1 changed files with 17 additions and 17 deletions
|
@ -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)}
|
||||
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'"}
|
||||
[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;
|
||||
[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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue