13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
# File 'lib/rubygems/commands/compile_command.rb', line 13
def initialize
defaults = {
output: Dir.pwd,
abi_lock: :ruby
}
super "compile", "Create binary pre-compiled gem", defaults
add_option "-O", "--output DIR", "Directory where binary will be stored" do |value, options|
options[:output] = File.expand_path(value, Dir.pwd)
end
add_option "--include-shared-dir DIR", "Additional directory for shared libraries" do |value, options|
options[:include_shared_dir] = value
end
add_option "--prune", "Clean non-existing files during re-packaging" do |value, options|
options[:prune] = true
end
add_option "--abi-lock MODE",
"Lock to version of Ruby (ruby, strict, none)" do |value, options|
mode = ABIs[value]
unless mode
valid = ABIs.keys.sort
raise OptionParser::InvalidArgument, "#{value} (#{valid.join ', '} are valid)"
end
options[:abi_lock] = mode
end
add_option "-N", "--no-abi-lock", "Do not lock compiled Gem to Ruby's ABI (same as --abi-lock=none)" do |value, options|
options[:abi_lock] = :none
end
add_option "-S", "--strip [CMD]", "Strip symbols from generated binaries" do |value, options|
if value.nil? || value.empty?
options[:strip] = RbConfig::CONFIG["STRIP"]
else
options[:strip] = value
end
end
end
|