diff --git a/lib/mini_portile2/mini_portile_cmake.rb b/lib/mini_portile2/mini_portile_cmake.rb index 9fcfb4c..c85f280 100644 --- a/lib/mini_portile2/mini_portile_cmake.rb +++ b/lib/mini_portile2/mini_portile_cmake.rb @@ -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++'