diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-02-12 10:29:47 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-02-12 10:33:53 +0900 |
| commit | 5c130e8e7be5797bea19ec138e39f15ce464f53e (patch) | |
| tree | a1697ce6001f405cc8c738b6c72c8f285edcaef9 /lib | |
| parent | 69f8a52866e83951bdfcfc3cae4f83a34c17bd9d (diff) | |
| download | mruby-5c130e8e7be5797bea19ec138e39f15ce464f53e.tar.gz mruby-5c130e8e7be5797bea19ec138e39f15ce464f53e.zip | |
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-`.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/mruby/gem.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/mruby/gem.rb b/lib/mruby/gem.rb index 48a14fc54..3a40fbbfc 100644 --- a/lib/mruby/gem.rb +++ b/lib/mruby/gem.rb @@ -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 |
