instance method
Gem::Ext::CmakeBuilder#check_presets
check_presets(cmake_dir, args, results)
lib/rubygems/ext/cmake_builder.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/rubygems/ext/cmake_builder.rb, line 85
def check_presets(cmake_dir, args, results)
# Return if the user specified a preset
return unless args.grep(/--preset/i).empty?
cmd = ["cmake",
"--list-presets"]
presets = Array.new
begin
runner.call(cmd, presets, "cmake_presets", cmake_dir)
# Remove the first two lines of the array which is the current_directory and the command
# that was run
presets = presets[2..].join
results << <<~EOS
The gem author provided a list of presets that can be used to build the gem. To use a preset specify it on the command line:
gem install <gem_name> -- --preset <preset_name>
#{presets}
EOS
rescue Gem::InstallError
# Do nothing, CMakePresets.json was not included in the Gem
end
end
No documentation available