Commit c858cba3 authored by KOBAYASHI Shuji's avatar KOBAYASHI Shuji

Refine `preprocess_options`; ref d95ffb03

If we modify an option that may have been specified by users, we may
make unintended changes, so it is better not to modify it as much as
possible, IMO.
parent 56842628
...@@ -24,7 +24,7 @@ MRuby::Build.new do |conf| ...@@ -24,7 +24,7 @@ MRuby::Build.new do |conf|
# cc.defines = %w() # cc.defines = %w()
# cc.option_include_path = %q[-I"%s"] # cc.option_include_path = %q[-I"%s"]
# cc.option_define = '-D%s' # cc.option_define = '-D%s'
# cc.compile_options = %Q[%{flags} -MMD -o "%{outfile}" -c "%{infile}"] # cc.compile_options = %Q[%{flags} -MMD -MF "%{outfile}".d -o "%{outfile}" -c "%{infile}"]
# end # end
# mrbc settings # mrbc settings
......
...@@ -92,7 +92,7 @@ module MRuby ...@@ -92,7 +92,7 @@ module MRuby
opts = compile_options opts = compile_options
else else
label = "CPP" label = "CPP"
opts = preprocess_options.gsub(/-MMD -MF .* -o/, "-o") opts = preprocess_options
flags << " -DMRB_PRESYM_SCANNING" flags << " -DMRB_PRESYM_SCANNING"
end end
_pp label, infile.relative_path, outfile.relative_path _pp label, infile.relative_path, outfile.relative_path
......
...@@ -3,7 +3,7 @@ MRuby::Toolchain.new(:gcc) do |conf, params| ...@@ -3,7 +3,7 @@ MRuby::Toolchain.new(:gcc) do |conf, params|
compiler_flags = %w(-g -O3 -Wall -Wundef) compiler_flags = %w(-g -O3 -Wall -Wundef)
c_mandatory_flags = %w(-std=gnu99) c_mandatory_flags = %w(-std=gnu99)
cxx_invalid_flags = %w(-Werror-implicit-function-declaration) cxx_invalid_flags = %w(-Werror-implicit-function-declaration)
compile_opt = '%{flags} -MMD -MF "%{outfile}.d" -o "%{outfile}" "%{infile}"' compile_opt = '%{flags} -o "%{outfile}" "%{infile}"'
[conf.cc, conf.objc, conf.asm, conf.cxx].each do |compiler| [conf.cc, conf.objc, conf.asm, conf.cxx].each do |compiler|
if compiler == conf.cxx if compiler == conf.cxx
...@@ -15,7 +15,7 @@ MRuby::Toolchain.new(:gcc) do |conf, params| ...@@ -15,7 +15,7 @@ MRuby::Toolchain.new(:gcc) do |conf, params|
end end
compiler.option_include_path = %q[-I"%s"] compiler.option_include_path = %q[-I"%s"]
compiler.option_define = '-D%s' compiler.option_define = '-D%s'
compiler.compile_options = "-c #{compile_opt}" compiler.compile_options = %|-MMD -MF "%{outfile}.d" -c #{compile_opt}|
compiler.preprocess_options = "-E -P #{compile_opt}" compiler.preprocess_options = "-E -P #{compile_opt}"
compiler.cxx_compile_flag = '-x c++ -std=gnu++03' compiler.cxx_compile_flag = '-x c++ -std=gnu++03'
compiler.cxx_exception_flag = '-fexceptions' compiler.cxx_exception_flag = '-fexceptions'
......
...@@ -11,7 +11,8 @@ MRuby::Toolchain.new(:openwrt) do |conf| ...@@ -11,7 +11,8 @@ MRuby::Toolchain.new(:openwrt) do |conf|
end end
cc.option_include_path = %q[-I"%s"] cc.option_include_path = %q[-I"%s"]
cc.option_define = '-D%s' cc.option_define = '-D%s'
cc.compile_options = %q[%{flags} -MMD -MF "%{outfile}.d" -o "%{outfile}" -c "%{infile}"] cc.compile_options = '%{flags} -MMD -MF "%{outfile}.d" -o "%{outfile}" -c "%{infile}"'
cc.preprocess_options = '%{flags} -o "%{outfile}" -E -P "%{infile}"'
end end
conf.linker do |linker| conf.linker do |linker|
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment