Skip to content

Commit

Permalink
mkmf: Add a way to provide a custom rbconfig.rb file
Browse files Browse the repository at this point in the history
  • Loading branch information
kateinoigakukun committed Mar 17, 2024
1 parent 8c81a6b commit 9f3090c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/mkmf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ def quote
# correctly compile and link the C extension to Ruby and a third-party
# library.
module MakeMakefile

if found_index = ARGV.find_index {|arg| arg.start_with?("--target-rbconfig=") }
found = ARGV.delete_at(found_index)
target_rbconfig = found.sub(/\A--target-rbconfig=/, "")
Kernel.load target_rbconfig, self
else
##
# The RbConfig for the target platform where the built extension runs.
RbConfig = ::RbConfig
end

#### defer until this module become global-state free.
# def self.extended(obj)
# obj.init_mkmf
Expand Down

0 comments on commit 9f3090c

Please sign in to comment.