Skip to content

Commit 01f06fd

Browse files
authored
Merge pull request #630 from junaruga/wip/print-compiler-version
Print the Ruby and compiler info or the command itself before compiling.
2 parents bd7b593 + 8aee873 commit 01f06fd

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Rakefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ require 'bundler/gem_tasks'
55
begin
66
require 'rake/extensiontask'
77
Rake::ExtensionTask.new('openssl')
8+
# Run the debug_compiler task before the compile task.
9+
Rake::Task['compile'].prerequisites.unshift :debug_compiler
810
rescue LoadError
911
warn "rake-compiler not installed. Run 'bundle install' to " \
1012
"install testing dependency gems."
@@ -22,6 +24,19 @@ RDoc::Task.new do |rdoc|
2224
end
2325

2426
task :test => [:compile, :debug]
27+
28+
# Print Ruby and compiler info for debugging purpose.
29+
task :debug_compiler do
30+
ruby '-v'
31+
compiler = RbConfig::CONFIG['CC']
32+
case compiler
33+
when 'gcc', 'clang'
34+
sh "#{compiler} --version"
35+
else
36+
puts "Compiler: #{RbConfig::CONFIG['CC']}"
37+
end
38+
end
39+
2540
task :debug do
2641
ruby "-I./lib -ropenssl -ve'puts OpenSSL::OPENSSL_VERSION, OpenSSL::OPENSSL_LIBRARY_VERSION'"
2742
end

0 commit comments

Comments
 (0)