module RbSys::Mkmf

def gsub_cargo_command!(cargo_command, builder:)

def gsub_cargo_command!(cargo_command, builder:)
  cargo_command.gsub!(/--profile \w+/, "$(RB_SYS_CARGO_PROFILE_FLAG)")
  cargo_command.gsub!(%r{--features \S+}, "--features $(RB_SYS_CARGO_FEATURES)")
  cargo_command.gsub!(%r{/target/\w+/}, "/target/$(RB_SYS_TARGET_DIR)/")
  cargo_command
end