summaryrefslogtreecommitdiffhomepage
path: root/tasks/mruby_build_commands.rake
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-05-01 22:00:27 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-05-01 22:00:27 +0900
commit41dbcf7a3ffa48faba27c57e917bbcde99fbf707 (patch)
tree775bc959ca2cb0562aa9f78d7e11b9c24d667055 /tasks/mruby_build_commands.rake
parentc17761d5dd7a34569f8348138f78e90457fa019f (diff)
parent052fe512799c2aba7dc9171ebe4e2558b6b6db65 (diff)
downloadmruby-41dbcf7a3ffa48faba27c57e917bbcde99fbf707.tar.gz
mruby-41dbcf7a3ffa48faba27c57e917bbcde99fbf707.zip
Merge pull request #2165 from take-cheeze/header_searcher
Implement header searcher to use readline in mirb if possible.
Diffstat (limited to 'tasks/mruby_build_commands.rake')
-rw-r--r--tasks/mruby_build_commands.rake12
1 files changed, 12 insertions, 0 deletions
diff --git a/tasks/mruby_build_commands.rake b/tasks/mruby_build_commands.rake
index 4beb7e743..4fbfaa785 100644
--- a/tasks/mruby_build_commands.rake
+++ b/tasks/mruby_build_commands.rake
@@ -54,6 +54,18 @@ module MRuby
@compile_options = '%{flags} -o %{outfile} -c %{infile}'
end
+ alias header_search_paths include_paths
+ def search_header_path(name)
+ header_search_paths.find do |v|
+ File.exist? build.filename("#{v}/#{name}").sub(/^"(.*)"$/, '\1')
+ end
+ end
+
+ def search_header(name)
+ path = search_header_path name
+ path && build.filename("#{path}/#{name}").sub(/^"(.*)"$/, '\1')
+ end
+
def all_flags(_defineds=[], _include_paths=[], _flags=[])
define_flags = [defines, _defineds].flatten.map{ |d| option_define % d }
include_path_flags = [include_paths, _include_paths].flatten.map do |f|