Improve determining C++ compiler in tasks/toolchains/gcc.rake

* Consider CC envvar as C compiler on which to make the decision.
* Consider the case where C compiler is `ccache gcc`, etc.
This commit is contained in:
KOBAYASHI Shuji
2020-11-21 12:25:50 +09:00
parent fb028b47aa
commit 98d0f1b98e
+1 -1
View File
@@ -6,7 +6,7 @@ MRuby::Toolchain.new(:gcc) do |conf, params|
[conf.cc, conf.objc, conf.asm, conf.cxx].each do |compiler|
if compiler == conf.cxx
compiler.command = ENV['CXX'] || default_command.sub(/cc|$/, '++')
compiler.command = ENV['CXX'] || conf.cc.command.sub(/g\Kcc|$/, '++')
compiler.flags = [ENV['CXXFLAGS'] || ENV['CFLAGS'] || compiler_flags]
else
compiler.command = ENV['CC'] || default_command