diff --git a/Library/Homebrew/extend/ENV/shared.rb b/Library/Homebrew/extend/ENV/shared.rb index 57b9a7f1ed..19af48698c 100644 --- a/Library/Homebrew/extend/ENV/shared.rb +++ b/Library/Homebrew/extend/ENV/shared.rb @@ -203,6 +203,12 @@ module SharedEnvExtension end def fortran + # Ignore repeated calls to this function as it will misleadingly warn about + # building with an alternative Fortran compiler without optimization flags, + # despite it often being the Homebrew-provided one set up in the first call. + return if @fortran_setup_done + @fortran_setup_done = true + flags = [] if fc