diff options
| author | take_cheeze <[email protected]> | 2014-05-01 16:42:34 +0900 |
|---|---|---|
| committer | take_cheeze <[email protected]> | 2014-05-01 16:49:54 +0900 |
| commit | b4a702f27d42ac141dea7e880360670ed054599e (patch) | |
| tree | 9b832387b0ea5a13d5e7fe6404f267a0c7f01808 /tasks/mruby_build_commands.rake | |
| parent | cb2548141b743c2d5a6b03f99a45bf2707cf59f7 (diff) | |
| download | mruby-b4a702f27d42ac141dea7e880360670ed054599e.tar.gz mruby-b4a702f27d42ac141dea7e880360670ed054599e.zip | |
Implement header search for gcc and clang.
Diffstat (limited to 'tasks/mruby_build_commands.rake')
| -rw-r--r-- | tasks/mruby_build_commands.rake | 12 |
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| |
