From be76cec3422ddedbfce48768db5aec004e2f0aee Mon Sep 17 00:00:00 2001 From: KOBAYASHI Shuji Date: Fri, 13 Sep 2019 17:14:37 +0900 Subject: Fix warnings for invalid C++ option with `enable_cxx_abi`; ref #3618, #4703 --- lib/mruby/build.rb | 2 +- lib/mruby/build/command.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/mruby/build.rb b/lib/mruby/build.rb index 5bedfc0e6..375b2933a 100644 --- a/lib/mruby/build.rb +++ b/lib/mruby/build.rb @@ -162,7 +162,7 @@ module MRuby compilers.each { |c| c.defines += %w(MRB_ENABLE_CXX_EXCEPTION MRB_ENABLE_CXX_ABI) c.flags << c.cxx_compile_flag - c.flags.delete('-std=gnu99') + c.flags = c.flags.flatten - c.cxx_invalid_flags.flatten } linker.command = cxx.command if toolchains.find { |v| v == 'gcc' } @cxx_abi_enabled = true diff --git a/lib/mruby/build/command.rb b/lib/mruby/build/command.rb index a98f2ca7e..bff250c93 100644 --- a/lib/mruby/build/command.rb +++ b/lib/mruby/build/command.rb @@ -41,7 +41,7 @@ module MRuby class Command::Compiler < Command attr_accessor :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 + attr_accessor :cxx_compile_flag, :cxx_exception_flag, :cxx_invalid_flags def initialize(build, source_exts=[]) super(build) @@ -53,6 +53,7 @@ module MRuby @option_include_path = '-I%s' @option_define = '-D%s' @compile_options = '%{flags} -o %{outfile} -c %{infile}' + @cxx_invalid_flags = [] end alias header_search_paths include_paths -- cgit v1.2.3