mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-19 20:09:01 +02:00
build-support/lib/meson: Statically compute default meson flags
This commit is contained in:
parent
5ef1bd952c
commit
085c172348
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue