Commit f38928df authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #2166 from take-cheeze/fix_for_1_8

Remove use of define_singleton_method.
parents 41dbcf7a 2063bee7
...@@ -30,10 +30,11 @@ MRuby::Toolchain.new(:gcc) do |conf| ...@@ -30,10 +30,11 @@ MRuby::Toolchain.new(:gcc) do |conf|
end end
[[conf.cc, 'c'], [conf.cxx, 'c++']].each do |cc, lang| [[conf.cc, 'c'], [conf.cxx, 'c++']].each do |cc, lang|
cc.define_singleton_method(:header_search_paths) do cc.instance_variable_set :@header_search_language, lang
def cc.header_search_paths
if @header_search_command != command if @header_search_command != command
result = `echo | #{build.filename command} -x#{lang} -Wp,-v - -fsyntax-only 2>&1` result = `echo | #{build.filename command} -x#{@header_search_language} -Wp,-v - -fsyntax-only 2>&1`
result = `echo | #{command} -x#{lang} -Wp,-v - -fsyntax-only 2>&1` if $?.exitstatus != 0 result = `echo | #{command} -x#{@header_search_language} -Wp,-v - -fsyntax-only 2>&1` if $?.exitstatus != 0
return include_paths if $?.exitstatus != 0 return include_paths if $?.exitstatus != 0
@frameworks = [] @frameworks = []
......
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