|
|
|
@ -2,6 +2,10 @@ |
|
|
|
|
|
|
|
|
|
require 'mkmf' |
|
|
|
|
|
|
|
|
|
ext_name = "google/protobuf_c" |
|
|
|
|
|
|
|
|
|
dir_config(ext_name) |
|
|
|
|
|
|
|
|
|
if RUBY_PLATFORM =~ /darwin/ || RUBY_PLATFORM =~ /linux/ |
|
|
|
|
$CFLAGS += " -std=gnu99 -O3 -DNDEBUG -fvisibility=hidden -Wall -Wsign-compare -Wno-declaration-after-statement" |
|
|
|
|
else |
|
|
|
@ -14,7 +18,11 @@ if RUBY_PLATFORM =~ /linux/ |
|
|
|
|
$LDFLAGS += " -Wl,-wrap,memcpy" |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
$objs = ["protobuf.o", "convert.o", "defs.o", "message.o", |
|
|
|
|
"repeated_field.o", "map.o", "ruby-upb.o", "wrap_memcpy.o"] |
|
|
|
|
$VPATH << "$(srcdir)/third_party/utf8_range" |
|
|
|
|
$INCFLAGS << "$(srcdir)/third_party/utf8_range" |
|
|
|
|
|
|
|
|
|
$srcs = ["protobuf.c", "convert.c", "defs.c", "message.c", |
|
|
|
|
"repeated_field.c", "map.c", "ruby-upb.c", "wrap_memcpy.c", |
|
|
|
|
"utf8_range.c"] |
|
|
|
|
|
|
|
|
|
create_makefile("google/protobuf_c") |
|
|
|
|
create_makefile(ext_name) |
|
|
|
|