extconf.rb 564 B

1234567891011121314151617181920
  1. #!/usr/bin/ruby
  2. require 'mkmf'
  3. if RUBY_PLATFORM =~ /darwin/ || RUBY_PLATFORM =~ /linux/
  4. $CFLAGS += " -std=gnu99 -O3 -DNDEBUG -fvisibility=hidden -Wall -Wsign-compare -Wno-declaration-after-statement"
  5. else
  6. $CFLAGS += " -std=gnu99 -O3 -DNDEBUG"
  7. end
  8. if RUBY_PLATFORM =~ /linux/
  9. # Instruct the linker to point memcpy calls at our __wrap_memcpy wrapper.
  10. $LDFLAGS += " -Wl,-wrap,memcpy"
  11. end
  12. $objs = ["protobuf.o", "convert.o", "defs.o", "message.o",
  13. "repeated_field.o", "map.o", "ruby-upb.o", "wrap_memcpy.o"]
  14. create_makefile("google/protobuf_c")