summaryrefslogtreecommitdiffstats
path: root/pkgs/development/compilers/edk2
diff options
context:
space:
mode:
authorMarkus Partheymüller <markus.partheymueller@cyberus-technology.de>2020-04-20 13:30:35 +0200
committerMarkus Partheymüller <markus.partheymueller@cyberus-technology.de>2020-04-20 13:30:35 +0200
commit94d114dc2a9619843af8ea6b322ef2b4f44b982f (patch)
treec8a0a19569d4e98971da1a6f9a4b65b87900d907 /pkgs/development/compilers/edk2
parentfe8afcb993845505042b41f09a9c98f6748d7af2 (diff)
edk2/OVMF: Determine build type from CC setting
Diffstat (limited to 'pkgs/development/compilers/edk2')
-rw-r--r--pkgs/development/compilers/edk2/default.nix11
1 files changed, 8 insertions, 3 deletions
diff --git a/pkgs/development/compilers/edk2/default.nix b/pkgs/development/compilers/edk2/default.nix
index eb658431c926..1050119be53a 100644
--- a/pkgs/development/compilers/edk2/default.nix
+++ b/pkgs/development/compilers/edk2/default.nix
@@ -30,6 +30,11 @@ buildStdenv = if stdenv.isDarwin then
else
stdenv;
+buildType = if stdenv.isDarwin then
+ "CLANGPDB"
+ else
+ "GCC5";
+
edk2 = buildStdenv.mkDerivation {
pname = "edk2";
version = "201911";
@@ -44,9 +49,9 @@ edk2 = buildStdenv.mkDerivation {
buildInputs = [ libuuid pythonEnv ];
makeFlags = [ "-C BaseTools" ]
- ++ lib.optional (stdenv.isDarwin) [ "BUILD_CC=clang BUILD_CXX=clang++ BUILD_AS=clang" ];
+ ++ lib.optional (stdenv.cc.isClang) [ "BUILD_CC=clang BUILD_CXX=clang++ BUILD_AS=clang" ];
- NIX_CFLAGS_COMPILE = "-Wno-return-type" + lib.optionalString (!stdenv.isDarwin) " -Wno-error=stringop-truncation";
+ NIX_CFLAGS_COMPILE = "-Wno-return-type" + lib.optionalString (stdenv.cc.isGNU) " -Wno-error=stringop-truncation";
hardeningDisable = [ "format" "fortify" ];
@@ -66,7 +71,7 @@ edk2 = buildStdenv.mkDerivation {
};
passthru = {
- mkDerivation = projectDscPath: buildType: attrs: buildStdenv.mkDerivation ({
+ mkDerivation = projectDscPath: attrs: buildStdenv.mkDerivation ({
inherit (edk2) src;
buildInputs = [ bc pythonEnv ] ++ attrs.buildInputs or [];