summaryrefslogtreecommitdiffhomepage
path: root/tasks
diff options
context:
space:
mode:
authorcremno <[email protected]>2014-01-07 17:56:30 +0100
committercremno <[email protected]>2014-01-07 17:56:30 +0100
commitaa655b9ee13b2d26de7a633049e20742b7393e52 (patch)
treeb2708c1d3bae0dc0ba575079ed2663bbfeb07452 /tasks
parentcff4ac6bb7fac7cf72b58a0081d7dacd9c1f492c (diff)
downloadmruby-aa655b9ee13b2d26de7a633049e20742b7393e52.tar.gz
mruby-aa655b9ee13b2d26de7a633049e20742b7393e52.zip
remove superfluous includes
- reduce compile time by a little bit (full-core: ~0.7s for me) - thanks to 'include-what-you-use' for some help - include Standard C header files before any other (coding style)
Diffstat (limited to 'tasks')
-rw-r--r--tasks/mrbgem_spec.rake18
-rw-r--r--tasks/mrbgems_test.rake2
2 files changed, 14 insertions, 6 deletions
diff --git a/tasks/mrbgem_spec.rake b/tasks/mrbgem_spec.rake
index 70c44ed5e..e9caf1d3a 100644
--- a/tasks/mrbgem_spec.rake
+++ b/tasks/mrbgem_spec.rake
@@ -149,7 +149,7 @@ module MRuby
end
end # generate_gem_init
- def print_gem_init_header(f)
+ def print_gem_comment(f)
f.puts %Q[/*]
f.puts %Q[ * This file is loading the irep]
f.puts %Q[ * Ruby GEM code.]
@@ -158,15 +158,23 @@ module MRuby
f.puts %Q[ * This file was generated!]
f.puts %Q[ * All manual changes will get lost.]
f.puts %Q[ */]
+ end
+
+ def print_gem_init_header(f)
+ print_gem_comment(f)
+ f.puts %Q[#include <stdlib.h>] unless rbfiles.empty?
+ f.puts %Q[#include "mruby.h"]
+ f.puts %Q[#include "mruby/irep.h"] unless rbfiles.empty?
+ end
+
+ def print_gem_test_header(f)
+ print_gem_comment(f)
f.puts %Q[#include <stdlib.h>]
f.puts %Q[#include "mruby.h"]
+ f.puts %Q[#include "mruby/array.h"]
f.puts %Q[#include "mruby/irep.h"]
- f.puts %Q[#include "mruby/dump.h"]
f.puts %Q[#include "mruby/string.h"]
- f.puts %Q[#include "mruby/proc.h"]
f.puts %Q[#include "mruby/variable.h"]
- f.puts %Q[#include "mruby/array.h"]
- f.puts %Q[#include "mruby/hash.h"]
end
def version_ok?(req_versions)
diff --git a/tasks/mrbgems_test.rake b/tasks/mrbgems_test.rake
index cf907a510..36c8e84b7 100644
--- a/tasks/mrbgems_test.rake
+++ b/tasks/mrbgems_test.rake
@@ -5,7 +5,7 @@ MRuby.each_target do
file test_rbobj => g.test_rbireps
file g.test_rbireps => [g.test_rbfiles].flatten + [g.build.mrbcfile] do |t|
open(t.name, 'w') do |f|
- g.print_gem_init_header(f)
+ g.print_gem_test_header(f)
test_preload = [g.dir, MRUBY_ROOT].map {|dir|
File.expand_path(g.test_preload, dir)
}.find {|file| File.exist?(file) }