|
|
|
@ -60,15 +60,8 @@ grpc_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..')) |
|
|
|
|
|
|
|
|
|
grpc_config = ENV['GRPC_CONFIG'] || 'opt' |
|
|
|
|
|
|
|
|
|
if ENV.key?('GRPC_LIB_DIR') |
|
|
|
|
grpc_lib_dir = File.join(grpc_root, ENV['GRPC_LIB_DIR']) |
|
|
|
|
else |
|
|
|
|
grpc_lib_dir = File.join(grpc_root, 'libs', grpc_config) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
ENV['MACOSX_DEPLOYMENT_TARGET'] = '10.7' |
|
|
|
|
|
|
|
|
|
unless File.exist?(File.join(grpc_lib_dir, 'libgrpc.a')) or windows |
|
|
|
|
ENV['AR'] = RbConfig::CONFIG['AR'] + ' rcs' |
|
|
|
|
ENV['CC'] = RbConfig::CONFIG['CC'] |
|
|
|
|
ENV['LD'] = ENV['CC'] |
|
|
|
@ -88,7 +81,6 @@ unless File.exist?(File.join(grpc_lib_dir, 'libgrpc.a')) or windows |
|
|
|
|
puts 'Building internal gRPC into ' + grpc_lib_dir |
|
|
|
|
system("make -j -C #{grpc_root} #{grpc_lib_dir}/libgrpc.a CONFIG=#{grpc_config}") |
|
|
|
|
exit 1 unless $? == 0 |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
$CFLAGS << ' -I' + File.join(grpc_root, 'include') |
|
|
|
|
$LDFLAGS << ' ' + File.join(grpc_lib_dir, 'libgrpc.a') unless windows |
|
|
|
|