wrapCCWith: structured argument for wrapper flags
Take a "nixSupport" argument that is an attrset of lists to append to "$out/nix-support/${name}" where name is the name of the attribute. This attrset is available from the passthru of the wrapped compiler. This is an alternative to imperatively issuing flags with extraBuildCommands and makes it possible to append or filter flags with an override.
This commit is contained in:
parent
28216de86b
commit
89a0dd2414
|
@ -14,6 +14,7 @@
|
|||
, nativeTools, noLibc ? false, nativeLibc, nativePrefix ? ""
|
||||
, propagateDoc ? cc != null && cc ? man
|
||||
, extraTools ? [], extraPackages ? [], extraBuildCommands ? ""
|
||||
, nixSupport ? {}
|
||||
, isGNU ? false, isClang ? cc.isClang or false, gnugrep ? null
|
||||
, buildPackages ? {}
|
||||
, libcxx ? null
|
||||
|
@ -155,6 +156,8 @@ stdenv.mkDerivation {
|
|||
(setenv "NIX_CFLAGS_COMPILE_${suffixSalt}" (concat (getenv "NIX_CFLAGS_COMPILE_${suffixSalt}") " -isystem " arg "/include"))))
|
||||
'(${concatStringsSep " " (map (pkg: "\"${pkg}\"") pkgs)}))
|
||||
'';
|
||||
|
||||
inherit nixSupport;
|
||||
};
|
||||
|
||||
dontBuild = true;
|
||||
|
@ -521,7 +524,11 @@ stdenv.mkDerivation {
|
|||
##
|
||||
## Extra custom steps
|
||||
##
|
||||
+ extraBuildCommands;
|
||||
+ extraBuildCommands
|
||||
+ lib.strings.concatStringsSep "; "
|
||||
(lib.attrsets.mapAttrsToList
|
||||
(name: value: "echo ${toString value} >> $out/nix-support/${name}")
|
||||
nixSupport);
|
||||
|
||||
inherit expand-response-params;
|
||||
|
||||
|
|
|
@ -13932,6 +13932,7 @@ with pkgs;
|
|||
# default.
|
||||
libcxx ? null
|
||||
, extraPackages ? lib.optional (cc.isGNU or false && stdenv.targetPlatform.isMinGW) threadsCross
|
||||
, nixSupport ? {}
|
||||
, ...
|
||||
} @ extraArgs:
|
||||
callPackage ../build-support/cc-wrapper (let self = {
|
||||
|
@ -13943,7 +13944,7 @@ with pkgs;
|
|||
isGNU = cc.isGNU or false;
|
||||
isClang = cc.isClang or false;
|
||||
|
||||
inherit cc bintools libc libcxx extraPackages zlib;
|
||||
inherit cc bintools libc libcxx extraPackages nixSupport zlib;
|
||||
} // extraArgs; in self);
|
||||
|
||||
wrapCC = cc: wrapCCWith {
|
||||
|
|
Loading…
Reference in a new issue