summaryrefslogtreecommitdiffhomepage
path: root/tasks/toolchains/gcc.rake
diff options
context:
space:
mode:
authortake_cheeze <[email protected]>2014-05-01 22:51:35 +0900
committertake_cheeze <[email protected]>2014-05-01 22:51:35 +0900
commit2063bee7cc6c1fd50bf9bf1a11c283376fdcdd3a (patch)
tree74abaa37d0153f9ca32de8b389c5528fff2c50cc /tasks/toolchains/gcc.rake
parent41dbcf7a3ffa48faba27c57e917bbcde99fbf707 (diff)
downloadmruby-2063bee7cc6c1fd50bf9bf1a11c283376fdcdd3a.tar.gz
mruby-2063bee7cc6c1fd50bf9bf1a11c283376fdcdd3a.zip
Remove use of define_singleton_method.
Diffstat (limited to 'tasks/toolchains/gcc.rake')
-rw-r--r--tasks/toolchains/gcc.rake7
1 files changed, 4 insertions, 3 deletions
diff --git a/tasks/toolchains/gcc.rake b/tasks/toolchains/gcc.rake
index d33910875..821100748 100644
--- a/tasks/toolchains/gcc.rake
+++ b/tasks/toolchains/gcc.rake
@@ -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 = []