extconf.rb 564 B

123456789101112131415161718192021
  1. #!/usr/bin/ruby
  2. require 'mkmf'
  3. if RUBY_PLATFORM =~ /darwin/ || RUBY_PLATFORM =~ /linux/
  4. $CFLAGS += " -std=gnu90 -O3 -DNDEBUG -Wall -Wdeclaration-after-statement -Wsign-compare"
  5. else
  6. $CFLAGS += " -std=gnu90 -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", "defs.o", "storage.o", "message.o",
  13. "repeated_field.o", "map.o", "encode_decode.o", "upb.o",
  14. "wrap_memcpy.o"]
  15. create_makefile("google/protobuf_c")