aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ruby/ext
diff options
context:
space:
mode:
authorGravatar Sree Kuchibhotla <sreek@google.com>2017-03-08 10:40:38 -0800
committerGravatar Sree Kuchibhotla <sreek@google.com>2017-03-08 10:40:38 -0800
commit36108cce7ddd5c5593b2d36c6105f6a39511b6a2 (patch)
tree1c6d32d0a05f0b185fe1f6232dad1c6e6fa915e2 /src/ruby/ext
parenteeea666cb1e3b9d9cb74e87b72029dccac8151ff (diff)
parentd1287b580e9a4dff160d61bb5766c2fd95fe4c79 (diff)
Merge branch 'master' into cq_create_api_changes
Diffstat (limited to 'src/ruby/ext')
-rw-r--r--src/ruby/ext/grpc/extconf.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ruby/ext/grpc/extconf.rb b/src/ruby/ext/grpc/extconf.rb
index b379664bab..ecb66239b9 100644
--- a/src/ruby/ext/grpc/extconf.rb
+++ b/src/ruby/ext/grpc/extconf.rb
@@ -27,6 +27,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+require 'etc'
require 'mkmf'
LIBDIR = RbConfig::CONFIG['libdir']
@@ -80,7 +81,9 @@ ENV['BUILDDIR'] = output_dir
unless windows
puts 'Building internal gRPC into ' + grpc_lib_dir
- system("make -j -C #{grpc_root} #{grpc_lib_dir}/libgrpc.a CONFIG=#{grpc_config}")
+ nproc = 4
+ nproc = Etc.nprocessors * 2 if Etc.respond_to? :nprocessors
+ system("make -j#{nproc} -C #{grpc_root} #{grpc_lib_dir}/libgrpc.a CONFIG=#{grpc_config}")
exit 1 unless $? == 0
end