summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2020-11-25 15:31:39 +0900
committerGitHub <[email protected]>2020-11-25 15:31:39 +0900
commit6e17122c6d27c7b87f98d4937cfbb51ec1b3b521 (patch)
tree1c604b01ea9e58d796fb6f85d8159acf82dbfc09
parent6a284872cefae393a5b1b5ec648b4875d0ba34b7 (diff)
parent038bad2f41c675e01e24e780a1fba71d1200535f (diff)
downloadmruby-6e17122c6d27c7b87f98d4937cfbb51ec1b3b521.tar.gz
mruby-6e17122c6d27c7b87f98d4937cfbb51ec1b3b521.zip
Merge pull request #5190 from shuujii/allow-compiler-name-in-build-log-to-be-customized
Allow compiler name in build log to be customized
-rw-r--r--lib/mruby/build.rb8
-rw-r--r--lib/mruby/build/command.rb7
2 files changed, 8 insertions, 7 deletions
diff --git a/lib/mruby/build.rb b/lib/mruby/build.rb
index d01d417de..a03c5fefe 100644
--- a/lib/mruby/build.rb
+++ b/lib/mruby/build.rb
@@ -78,10 +78,10 @@ module MRuby
@file_separator = '/'
@build_dir = "#{build_dir}/#{@name}"
@gem_clone_dir = "#{build_dir}/repos/#{@name}"
- @cc = Command::Compiler.new(self, %w(.c))
- @cxx = Command::Compiler.new(self, %w(.cc .cxx .cpp))
- @objc = Command::Compiler.new(self, %w(.m))
- @asm = Command::Compiler.new(self, %w(.S .asm))
+ @cc = Command::Compiler.new(self, %w(.c), label: "CC")
+ @cxx = Command::Compiler.new(self, %w(.cc .cxx .cpp), label: "CXX")
+ @objc = Command::Compiler.new(self, %w(.m), label: "OBJC")
+ @asm = Command::Compiler.new(self, %w(.S .asm), label: "ASM")
@linker = Command::Linker.new(self)
@archiver = Command::Archiver.new(self)
@yacc = Command::Yacc.new(self)
diff --git a/lib/mruby/build/command.rb b/lib/mruby/build/command.rb
index 6b8aca04a..80657eadc 100644
--- a/lib/mruby/build/command.rb
+++ b/lib/mruby/build/command.rb
@@ -39,13 +39,14 @@ module MRuby
end
class Command::Compiler < Command
- attr_accessor :flags, :include_paths, :defines, :source_exts
+ attr_accessor :label, :flags, :include_paths, :defines, :source_exts
attr_accessor :compile_options, :option_define, :option_include_path, :out_ext
attr_accessor :cxx_compile_flag, :cxx_exception_flag, :cxx_invalid_flags
- def initialize(build, source_exts=[])
+ def initialize(build, source_exts=[], label: "CC")
super(build)
@command = ENV['CC'] || 'cc'
+ @label = label
@flags = [ENV['CFLAGS'] || []]
@source_exts = source_exts
@include_paths = ["#{MRUBY_ROOT}/include"]
@@ -78,7 +79,7 @@ module MRuby
def run(outfile, infile, _defines=[], _include_paths=[], _flags=[])
mkdir_p File.dirname(outfile)
- _pp "CC", infile.relative_path, outfile.relative_path
+ _pp @label, infile.relative_path, outfile.relative_path
_run compile_options, { :flags => all_flags(_defines, _include_paths, _flags),
:infile => filename(infile), :outfile => filename(outfile) }
end