Skip to content

Commit

Permalink
Merge pull request #630 from junaruga/wip/print-compiler-version
Browse files Browse the repository at this point in the history
Print the Ruby and compiler info or the command itself before compiling.
  • Loading branch information
junaruga authored Jun 1, 2023
2 parents bd7b593 + 8aee873 commit 01f06fd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ require 'bundler/gem_tasks'
begin
require 'rake/extensiontask'
Rake::ExtensionTask.new('openssl')
# Run the debug_compiler task before the compile task.
Rake::Task['compile'].prerequisites.unshift :debug_compiler
rescue LoadError
warn "rake-compiler not installed. Run 'bundle install' to " \
"install testing dependency gems."
Expand All @@ -22,6 +24,19 @@ RDoc::Task.new do |rdoc|
end

task :test => [:compile, :debug]

# Print Ruby and compiler info for debugging purpose.
task :debug_compiler do
ruby '-v'
compiler = RbConfig::CONFIG['CC']
case compiler
when 'gcc', 'clang'
sh "#{compiler} --version"
else
puts "Compiler: #{RbConfig::CONFIG['CC']}"
end
end

task :debug do
ruby "-I./lib -ropenssl -ve'puts OpenSSL::OPENSSL_VERSION, OpenSSL::OPENSSL_LIBRARY_VERSION'"
end
Expand Down

0 comments on commit 01f06fd

Please sign in to comment.