Sha256: a1859330bf8d573066eccdadbed7457793152d9c8285f28f3367753002ca6e84

Contents?: true

Size: 613 Bytes

Versions: 20

Compression:

Stored size: 613 Bytes

Contents

# frozen_string_literal: true

class Gem::Ext::CargoBuilder < Gem::Ext::Builder
  # Converts Ruby link flags into something cargo understands
  class LinkFlagConverter
    def self.convert(arg)
      case arg.chomp
      when /^-L\s*(.+)$/
        ["-L", "native=#{$1}"]
      when /^--library=(\w+\S+)$/, /^-l\s*(\w+\S+)$/
        ["-l", $1]
      when /^-l\s*:lib(\S+).a$/
        ["-l", "static=#{$1}"]
      when /^-l\s*:lib(\S+).(so|dylib|dll)$/
        ["-l", "dylib=#{$1}"]
      when /^-F\s*(.*)$/
        ["-l", "framework=#{$1}"]
      else
        ["-C", "link_arg=#{arg}"]
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 3 rubygems

Version Path
rubygems-update-3.3.27 lib/rubygems/ext/cargo_builder/link_flag_converter.rb
rubygems-update-3.3.26 lib/rubygems/ext/cargo_builder/link_flag_converter.rb
rubygems-update-3.3.25 lib/rubygems/ext/cargo_builder/link_flag_converter.rb
rubygems-update-3.3.24 lib/rubygems/ext/cargo_builder/link_flag_converter.rb
rubygems-update-3.3.23 lib/rubygems/ext/cargo_builder/link_flag_converter.rb
rubygems-update-3.3.22 lib/rubygems/ext/cargo_builder/link_flag_converter.rb
rubygems-update-3.3.21 lib/rubygems/ext/cargo_builder/link_flag_converter.rb
rubygems-update-3.3.20 lib/rubygems/ext/cargo_builder/link_flag_converter.rb
rubygems-update-3.3.19 lib/rubygems/ext/cargo_builder/link_flag_converter.rb
rubygems-update-3.3.18 lib/rubygems/ext/cargo_builder/link_flag_converter.rb
rubygems-update-3.3.17 lib/rubygems/ext/cargo_builder/link_flag_converter.rb
rubygems-update-3.3.16 lib/rubygems/ext/cargo_builder/link_flag_converter.rb
rb_sys-0.9.0 vendor/rubygems/ext/cargo_builder/link_flag_converter.rb
rb_sys-0.1.3 vendor/rubygems/ext/cargo_builder/link_flag_converter.rb
rb_sys-0.1.2 vendor/rubygems/ext/cargo_builder/link_flag_converter.rb
rb_sys-0.1.1 vendor/rubygems/ext/cargo_builder/link_flag_converter.rb
rb_sys1-0.1.3 vendor/rubygems/ext/cargo_builder/link_flag_converter.rb
rb_sys1-0.1.2 vendor/rubygems/ext/cargo_builder/link_flag_converter.rb
rb_sys1-0.1.1 vendor/rubygems/ext/cargo_builder/link_flag_converter.rb
rb_sys1-0.1.0 vendor/rubygems/ext/cargo_builder/link_flag_converter.rb