Skip to content

Commit

Permalink
Merge pull request #449 from ruby/pr-acf8683dede39ad90db26650c07f4b9e…
Browse files Browse the repository at this point in the history
…97bc59d2

Allow using `CXX` in extconf.rb
  • Loading branch information
kateinoigakukun authored May 4, 2024
2 parents dde5b52 + 03c72b4 commit 9fda893
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/ruby_wasm/build/product/crossruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def feature_name(crossruby)
def make_args(crossruby)
make_args = []
make_args << "CC=#{@toolchain.cc}"
make_args << "CXX=#{@toolchain.cc}"
make_args << "LD=#{@toolchain.ld}"
make_args << "AR=#{@toolchain.ar}"
make_args << "RANLIB=#{@toolchain.ranlib}"
Expand Down
1 change: 1 addition & 0 deletions lib/ruby_wasm/build/product/product.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def system_triplet_args
def tools_args
args = []
args << "CC=#{@toolchain.cc}"
args << "CXX=#{@toolchain.cxx}"
args << "LD=#{@toolchain.ld}"
args << "AR=#{@toolchain.ar}"
args << "RANLIB=#{@toolchain.ranlib}"
Expand Down
3 changes: 2 additions & 1 deletion lib/ruby_wasm/build/toolchain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def self.check_executable(command)
tool
end

%i[cc ranlib ld ar].each do |name|
%i[cc cxx ranlib ld ar].each do |name|
define_method(name) do
@tools_cache ||= {}
@tools_cache[name] ||= find_tool(name)
Expand Down Expand Up @@ -84,6 +84,7 @@ def initialize(

@tools = {
cc: "#{wasi_sdk_path}/bin/clang",
cxx: "#{wasi_sdk_path}/bin/clang++",
ld: "#{wasi_sdk_path}/bin/clang",
ar: "#{wasi_sdk_path}/bin/llvm-ar",
ranlib: "#{wasi_sdk_path}/bin/llvm-ranlib"
Expand Down
1 change: 1 addition & 0 deletions sig/ruby_wasm/build.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ module RubyWasm
def self.find_path: (String command) -> String?
def self.check_executable: (String command) -> String
def cc: -> String
def cxx: -> String
def ranlib: -> String
def ld: -> String
def ar: -> String
Expand Down

0 comments on commit 9fda893

Please sign in to comment.