2016-02-01 07:43:26 -05:00
|
|
|
# frozen_string_literal: true
|
2013-10-16 18:37:39 -04:00
|
|
|
require 'rubygems/command'
|
|
|
|
|
2012-12-09 19:40:39 -05:00
|
|
|
class Gem::Ext::CmakeBuilder < Gem::Ext::Builder
|
2019-02-14 07:59:03 -05:00
|
|
|
|
2018-05-30 09:01:35 -04:00
|
|
|
def self.build(extension, dest_path, results, args=[], lib_dir=nil)
|
2018-11-21 05:20:47 -05:00
|
|
|
unless File.exist?('Makefile')
|
2012-12-09 19:40:39 -05:00
|
|
|
cmd = "cmake . -DCMAKE_INSTALL_PREFIX=#{dest_path}"
|
|
|
|
cmd << " #{Gem::Command.build_args.join ' '}" unless Gem::Command.build_args.empty?
|
|
|
|
|
|
|
|
run cmd, results
|
|
|
|
end
|
|
|
|
|
|
|
|
make dest_path, results
|
|
|
|
|
|
|
|
results
|
|
|
|
end
|
2019-02-14 07:59:03 -05:00
|
|
|
|
2012-12-09 19:40:39 -05:00
|
|
|
end
|