diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2016-01-31 09:24:11 +0100 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2016-01-31 09:24:11 +0100 |
commit | 09ac0a46f4ba899bea09c7d4da8dc7c1540f9978 (patch) | |
tree | 4909a0f105a332c19f356b583df1d6f78cc0e918 /Rakefile | |
parent | d2f20efcd8acfef059e21d5368f45c75a87185f0 (diff) |
Building the grpc DLLs.
Diffstat (limited to 'Rakefile')
-rwxr-xr-x | Rakefile | 28 |
1 files changed, 17 insertions, 11 deletions
@@ -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. |