1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-19 12:11:28 +00:00

emscripten: Don't always clain to have a GCC

This commit is contained in:
John Ericson 2020-06-22 00:16:32 -04:00
parent 2c91b4358a
commit e00d4d6021

View file

@ -2,6 +2,7 @@
let
rev = emscriptenVersion;
haveGcc = stdenv.cc.isGNU || stdenv.cc.cc ? gcc;
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
in
stdenv.mkDerivation rec {
@ -34,7 +35,7 @@ stdenv.mkDerivation rec {
#"-DLLVM_CONFIG=${llvm}/bin/llvm-config"
"-DLLVM_BUILD_TESTS=ON"
"-DCLANG_INCLUDE_TESTS=ON"
] ++ (stdenv.lib.optional stdenv.isLinux
] ++ (stdenv.lib.optional (stdenv.isLinux && haveGcc)
# necessary for clang to find crtend.o
"-DGCC_INSTALL_PREFIX=${gcc}"
);
@ -42,6 +43,7 @@ stdenv.mkDerivation rec {
passthru = {
isClang = true;
} // stdenv.lib.optionalAttrs haveGcc {
inherit gcc;
};