From 09ac0a46f4ba899bea09c7d4da8dc7c1540f9978 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Sun, 31 Jan 2016 09:24:11 +0100 Subject: Building the grpc DLLs. --- Rakefile | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index ef4c7524e4..cd4f31731c 100755 --- a/Rakefile +++ b/Rakefile @@ -4,6 +4,8 @@ require 'rspec/core/rake_task' require 'rubocop/rake_task' require 'bundler/gem_tasks' +load 'tools/distrib/docker_for_windows.rb' + # Add rubocop style checking tasks RuboCop::RakeTask.new(:rubocop) do |task| task.options = ['-c', 'src/ruby/.rubocop.yml'] @@ -60,20 +62,24 @@ end desc 'Build the gem file under rake_compiler_dock' task 'gem:windows' do - require 'digest' - require 'rake_compiler_dock' - grpc_config = ENV['GRPC_CONFIG'] || 'opt' V = ENV['V'] || '0' - version = Digest::SHA1.file('third_party/rake-compiler-dock/Dockerfile').hexdigest - image_name = 'grpc/rake-compiler-dock:' + version - cmd = "docker build -t #{image_name} third_party/rake-compiler-dock" - puts cmd - system cmd - exit 1 unless $? == 0 - ENV['RAKE_COMPILER_DOCK_IMAGE'] = image_name - RakeCompilerDock.sh "bundle && rake cross native gem RUBY_CC_VERSION=2.3.0:2.2.2:2.1.6:2.0.0 GRPC_CONFIG=#{grpc_config} V=#{V}" + env = 'CPPFLAGS="-D_WIN32_WINNT=0x600 -DUNICODE -D_UNICODE" ' + env += 'SYSTEM=MINGW32 ' + env += 'EMBED_ZLIB=true ' + env += 'BUILDDIR=/tmp ' + out = '/tmp/libs/opt/grpc-0.dll' + + env_comp = 'CC=x86_64-w64-mingw32-gcc ' + env_comp += 'LD=x86_64-w64-mingw32-gcc ' + docker_for_windows "#{env} #{env_comp} make #{out} && cp #{out} grpc_c.64.ruby" + + env_comp = 'CC=i686-w64-mingw32-gcc ' + env_comp += 'LD=i686-w64-mingw32-gcc ' + docker_for_windows "#{env} #{env_comp} make #{out} && cp #{out} grpc_c.32.ruby" + + docker_for_windows "bundle && rake cross native gem RUBY_CC_VERSION=2.3.0:2.2.2:2.1.6:2.0.0 GRPC_CONFIG=#{grpc_config} V=#{V}" end # Define dependencies between the suites. -- cgit v1.2.3