ENV: only set fortran flags in one place
This commit is contained in:
parent
8828187b4c
commit
6b79a4e714
@ -120,15 +120,15 @@ module SharedEnvExtension
|
||||
end
|
||||
|
||||
def fortran
|
||||
flags = []
|
||||
|
||||
if fc
|
||||
ohai "Building with an alternative Fortran compiler"
|
||||
puts "This is unsupported."
|
||||
self['F77'] ||= fc
|
||||
|
||||
if ARGV.include? '--default-fortran-flags'
|
||||
flags_to_set = FC_FLAG_VARS.reject { |key| self[key] }
|
||||
flags_to_set.each {|key| self[key] = cflags}
|
||||
set_cpu_flags(flags_to_set)
|
||||
flags = FC_FLAG_VARS.reject { |key| self[key] }
|
||||
elsif values_at(*FC_FLAG_VARS).compact.empty?
|
||||
opoo <<-EOS.undent
|
||||
No Fortran optimization information was provided. You may want to consider
|
||||
@ -144,9 +144,10 @@ module SharedEnvExtension
|
||||
ohai "Using Homebrew-provided fortran compiler."
|
||||
puts "This may be changed by setting the FC environment variable."
|
||||
self['FC'] = self['F77'] = gfortran
|
||||
flags = FC_FLAG_VARS
|
||||
end
|
||||
|
||||
FC_FLAG_VARS.each {|key| self[key] = cflags}
|
||||
set_cpu_flags(FC_FLAG_VARS)
|
||||
end
|
||||
flags.each { |key| self[key] = cflags }
|
||||
set_cpu_flags(flags)
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user