class Object

Public Instance Methods

add_cflags(flags) click to toggle source

rubocop:disable Style/GlobalVars

# File ext/extconf_helpers.rb, line 5
def add_cflags flags
  print "checking if the C compiler accepts #{flags}... "
  with_cflags("#{$CFLAGS} #{flags}") do
    if test_compile
      puts 'OK'
      true
    else
      puts "\rC compiler does not accept #{flags}"
      false
    end
  end
end
test_compile() click to toggle source
# File ext/extconf_helpers.rb, line 18
def test_compile
  try_compile "int main() {return 0;}", "", {werror: true}
end