diff options
Diffstat (limited to 'lib/rubygems/ext')
-rw-r--r-- | lib/rubygems/ext/builder.rb | 13 | ||||
-rw-r--r-- | lib/rubygems/ext/cmake_builder.rb | 3 |
2 files changed, 6 insertions, 10 deletions
diff --git a/lib/rubygems/ext/builder.rb b/lib/rubygems/ext/builder.rb index 069ab4cfe0..761505636c 100644 --- a/lib/rubygems/ext/builder.rb +++ b/lib/rubygems/ext/builder.rb @@ -19,11 +19,6 @@ class Gem::Ext::Builder CHDIR_MUTEX = Mutex.new # :nodoc: - ## - # `make` targets to run when building the extension - - MAKE_TARGETS = ['clean', '', 'install'] # :nodoc: - attr_accessor :build_args # :nodoc: def self.class_name @@ -45,14 +40,18 @@ class Gem::Ext::Builder destdir = '"DESTDIR=%s"' % ENV['DESTDIR'] if RUBY_VERSION > '2.0' - self::MAKE_TARGETS.each do |target| + ['clean', '', 'install'].each do |target| # Pass DESTDIR via command line to override what's in MAKEFLAGS cmd = [ make_program, destdir, target ].join(' ').rstrip - run(cmd, results, "make #{target}".rstrip) + begin + run(cmd, results, "make #{target}".rstrip) + rescue Gem::InstallError + raise unless target == 'clean' # ignore clean failure + end end end diff --git a/lib/rubygems/ext/cmake_builder.rb b/lib/rubygems/ext/cmake_builder.rb index 8bd82dafe2..d6d106f4ae 100644 --- a/lib/rubygems/ext/cmake_builder.rb +++ b/lib/rubygems/ext/cmake_builder.rb @@ -1,7 +1,4 @@ class Gem::Ext::CmakeBuilder < Gem::Ext::Builder - - MAKE_TARGETS = ['', 'install'] # :nodoc: - def self.build(extension, directory, dest_path, results) unless File.exist?('Makefile') then cmd = "cmake . -DCMAKE_INSTALL_PREFIX=#{dest_path}" |