Do not collect linker options from binary gems; close #5210

Binary gems are mrbgems that set `spec.bins` in their `mrbgem.rake`,
and usually their names are prefixed with `mruby-bin-`.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2021-02-12 10:29:47 +09:00
parent 69f8a52866
commit 5c130e8e7b
3 changed files with 14 additions and 7 deletions
+8 -2
View File
@@ -119,6 +119,10 @@ module MRuby
@dir.start_with?("#{MRUBY_ROOT}/mrbgems/")
end
def bin?
@bins.size > 0
end
def add_dependency(name, *requirements)
default_gem = requirements.last.kind_of?(Hash) ? requirements.pop : nil
requirements = ['>= 0.0.0'] if requirements.empty?
@@ -496,8 +500,10 @@ module MRuby
end
end
def linker_attrs
map{|g| g.linker.run_attrs}.transpose
def linker_attrs(gem=nil)
gems = self.reject{|g| g.bin?} # library gems
gems << gem unless gem.nil?
gems.map{|g| g.linker.run_attrs}.transpose
end
end # List
end # Gem