Remove use of define_singleton_method.

This commit is contained in:
take_cheeze
2014-05-01 22:51:35 +09:00
parent 41dbcf7a3f
commit 2063bee7cc
+4 -3
View File
@@ -30,10 +30,11 @@ MRuby::Toolchain.new(:gcc) do |conf|
end
[[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
result = `echo | #{build.filename command} -x#{lang} -Wp,-v - -fsyntax-only 2>&1`
result = `echo | #{command} -x#{lang} -Wp,-v - -fsyntax-only 2>&1` if $?.exitstatus != 0
result = `echo | #{build.filename command} -x#{@header_search_language} -Wp,-v - -fsyntax-only 2>&1`
result = `echo | #{command} -x#{@header_search_language} -Wp,-v - -fsyntax-only 2>&1` if $?.exitstatus != 0
return include_paths if $?.exitstatus != 0
@frameworks = []