2121#
2222# Useful options to know are:
2323#
24- # -G to specicy a generator (-G Ninja is recommended)
24+ # -G to specify a generator (-G Ninja is recommended)
2525# -D<CMAKE_VARIABLE> to set a CMake variable (for example -DCMAKE_BUILD_TYPE=Release)
2626# --preset <preset_name> to use a preset
2727#
2828# If the Gem author provides presets, via CMakePresets.json file, you will likely want to us use one of them.
29- # If not, then you may wish to specify a generator (Ninja is recommened since it can builds projects in parallel
30- # versus a Make generator which is much slower).
29+ # If not, then you may wish to specify a generator (Ninja is recommended since it can build projects in parallel
30+ # versus a Make generator which build ins serial and thus is * much* slower).
3131
3232require "fileutils"
3333require 'open3'
@@ -47,6 +47,9 @@ def build(extension, gem_dir, results, args = [], lib_dir = nil, cmake_dir = Dir
4747 warn "--target-rbconfig is not yet supported for CMake extensions. Ignoring"
4848 end
4949
50+ # Make sure lib dir is set
51+ lib_dir ||= File . join ( gem_dir , "lib" )
52+
5053 # Figure the build dir
5154 build_dir = File . join ( cmake_dir , "build" )
5255
@@ -97,7 +100,7 @@ def check_presets(cmake_dir, args)
97100 stdout , stderr , status = Open3 . capture3 ( build_env , *cmd , chdir : cmake_dir )
98101 message = <<~EOS
99102 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:
100-
103+
101104 gem install <gem_name> -- --preset <preset_name>
102105
103106 #{ stdout }
0 commit comments