diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2011-08-06 18:19:15 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2011-08-06 19:16:42 -0700 |
commit | a1a9979e147a68c118051532ae3732edf4760d96 (patch) | |
tree | 9d49e09ec2eec826cdd567fc044befd8e2df3134 /lib/rake/extensiontask.rb | |
parent | 83d8702cff14fbcee14b36109e1e43ae9d91df92 (diff) | |
download | rake-compiler-a1a9979e147a68c118051532ae3732edf4760d96.tar.gz |
Emit JRuby cross-compile warnings only when actually doing cross-compiles.
Diffstat (limited to 'lib/rake/extensiontask.rb')
-rwxr-xr-x | lib/rake/extensiontask.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/rake/extensiontask.rb b/lib/rake/extensiontask.rb index 0ff0c1a..f0f7397 100755 --- a/lib/rake/extensiontask.rb +++ b/lib/rake/extensiontask.rb @@ -38,10 +38,6 @@ module Rake def binary(platform = nil) if platform == "java" - warn_once <<-EOF -Compiling a native C extension on JRuby. This is discouraged and a -Java extension should be preferred. - EOF "#{name}.#{RbConfig::MAKEFILE_CONFIG['DLEXT']}" else super @@ -106,6 +102,12 @@ Rerun `rake` under MRI Ruby 1.8.x/1.9.x to cross/native compile. # binary in temporary folder depends on makefile and source files # tmp/extension_name/extension_name.{so,bundle} file "#{tmp_path}/#{binary(platf)}" => ["#{tmp_path}/Makefile"] + source_files do + jruby_compile_msg = <<-EOF +Compiling a native C extension on JRuby. This is discouraged and a +Java extension should be preferred. + EOF + warn_once(jruby_compile_msg) if defined?(JRUBY_VERSION) + chdir tmp_path do sh make end |