Skip to content

Commit

Permalink
cmake: use RbConfig::CONFIG to help identify the compilers
Browse files Browse the repository at this point in the history
  • Loading branch information
flavorjones committed May 3, 2024
1 parent c0ec423 commit a894568
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/mini_portile2/mini_portile_cmake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,12 @@ def find_compiler(compilers)
# configure automatically searches for the right compiler based on the
# `--host` parameter. However, CMake doesn't have an equivalent feature.
# Search for the right compiler for the target architecture using
# some basic heruistics.
# some basic heuristics.
def find_c_and_cxx_compilers(host)
c_compiler = ENV["CC"]
cxx_compiler = ENV["CXX"]
c_compiler = ENV["CC"] || RbConfig::CONFIG["CC"]
cxx_compiler = ENV["CXX"] || RbConfig::CONFIG["CXX"]

# TODO: can we remove this if/else block and just rely on RbConfig::CONFIG?
if MiniPortile.darwin?
c_compiler ||= 'clang'
cxx_compiler ||='clang++'
Expand Down

0 comments on commit a894568

Please sign in to comment.