diff options
-rw-r--r-- | lib/rubygems/ext/cargo_builder.rb | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -1,7 +1,5 @@ # frozen_string_literal: true -require_relative "../shellwords" - # This class is used by rubygems to build Rust extensions. It is a thin-wrapper # over the `cargo rustc` command which takes care of building Rust code in a way # that Ruby can use. @@ -159,7 +157,7 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder # We want to use the same linker that Ruby uses, so that the linker flags from # mkmf work properly. def linker_args - cc_flag = Shellwords.split(makefile_config("CC")) linker = cc_flag.shift link_args = cc_flag.flat_map {|a| ["-C", "link-arg=#{a}"] } @@ -178,7 +176,7 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder def libruby_args(dest_dir) libs = makefile_config(ruby_static? ? "LIBRUBYARG_STATIC" : "LIBRUBYARG_SHARED") - raw_libs = Shellwords.split(libs) raw_libs.flat_map {|l| ldflag_to_link_modifier(l) } end @@ -261,7 +259,7 @@ EOF end def split_flags(var) - Shellwords.split(RbConfig::CONFIG.fetch(var, "")) end def ldflag_to_link_modifier(arg) |