2016-02-01 12:43:26 +00:00
|
|
|
# frozen_string_literal: true
|
2013-10-16 22:37:39 +00:00
|
|
|
require 'rubygems/command'
|
|
|
|
|
2012-12-10 00:40:39 +00:00
|
|
|
class Gem::Ext::CmakeBuilder < Gem::Ext::Builder
|
2019-02-14 12:59:03 +00:00
|
|
|
|
2018-05-30 13:01:35 +00:00
|
|
|
def self.build(extension, dest_path, results, args=[], lib_dir=nil)
|
2018-11-21 10:20:47 +00:00
|
|
|
unless File.exist?('Makefile')
|
2012-12-10 00:40:39 +00: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 12:59:03 +00:00
|
|
|
|
2012-12-10 00:40:39 +00:00
|
|
|
end
|