forked from mirrors/nixpkgs
Add a stdenv adapter ‘keepDebugInfo’ to make a debug build
This adapter causes the resulting binaries to have debug info and no optimisations. Example use (in all-packages.nix): foo = callPackage ./foo.nix { stdenv = keepDebugInfo stdenv; };
This commit is contained in:
parent
0dd3996ab4
commit
ccd44e84c8
|
@ -355,4 +355,16 @@ rec {
|
|||
drvPath = validate pkg.drvPath;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
/* Modify a stdenv so that it produces debug builds; that is,
|
||||
binaries have debug info, and compiler optimisations are
|
||||
disabled. */
|
||||
keepDebugInfo = stdenv: stdenv //
|
||||
{ mkDerivation = args: stdenv.mkDerivation (args // {
|
||||
dontStrip = true;
|
||||
NIX_CFLAGS_COMPILE = toString (args.NIX_CFLAGS_COMPILE or "") + " -g -O0";
|
||||
});
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue