diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index 3cc35a946164..8101394088fd 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -745,9 +745,17 @@ stdenvNoCC.mkDerivation { # no `/usr/include`, there’s essentially no risk to dropping # the flag there. See discussion in NixOS/nixpkgs#191152. # - + optionalString ((cc.isClang or false) && !(cc.isROCm or false) && !targetPlatform.isDarwin && !targetPlatform.isAndroid) '' - echo " -nostdlibinc" >> $out/nix-support/cc-cflags - '' + + + optionalString + ( + (cc.isClang or false) + && !(cc.isROCm or false) + && !targetPlatform.isDarwin + && !targetPlatform.isAndroid + ) + '' + echo " -nostdlibinc" >> $out/nix-support/cc-cflags + '' ## ## Man page and info support