summaryrefslogtreecommitdiffhomepage
path: root/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'tasks')
-rw-r--r--tasks/mruby_build.rake8
-rw-r--r--tasks/mruby_gem_spec.rake12
-rw-r--r--tasks/rules.rake2
3 files changed, 13 insertions, 9 deletions
diff --git a/tasks/mruby_build.rake b/tasks/mruby_build.rake
index fad92c5e1..65c80ab6a 100644
--- a/tasks/mruby_build.rake
+++ b/tasks/mruby_build.rake
@@ -20,7 +20,7 @@ module MRuby
attr_accessor :ld, :ldflags, :libs
attr_accessor :ar
attr_writer :cxx, :cxxflags
- attr_writer :objcc, :objccflags
+ attr_writer :objcc, :objcflags
attr_writer :asm, :asmflags
attr_accessor :gperf, :yacc
attr_accessor :cat, :git
@@ -46,13 +46,13 @@ module MRuby
end
def cxx; @cxx || cc; end
- def cxxflags; @cxxflags.empty? ? cflags : @cxxflags; end
+ def cxxflags; !@cxxflags || @cxxflags.empty? ? cflags : @cxxflags; end
def objcc; @objcc || cc; end
- def objccflags; @objccflags.empty? ? cflags : @objccflags; end
+ def objcflags; !@objcflags || @objcflags.empty? ? cflags : @objcflags; end
def asm; @asm || cc; end
- def asmflags; @asmflags.empty? ? cflags : @asmflags; end
+ def asmflags; !@asmflags || @asmflags.empty? ? cflags : @asmflags; end
def ld; @ld || cc; end
diff --git a/tasks/mruby_gem_spec.rake b/tasks/mruby_gem_spec.rake
index 59a536e2c..9f28b2b6a 100644
--- a/tasks/mruby_gem_spec.rake
+++ b/tasks/mruby_gem_spec.rake
@@ -33,7 +33,7 @@ module MRuby
@name = name
@build = MRuby.build
@dir = Gem.processing_path
- @cflags = []
+ @cflags, @cxxflags, @objcflags, @asmflags = [], [], [], []
@mruby_cflags, @mruby_ldflags, @mruby_libs = [], [], []
@mruby_includes = ["#{dir}/include"]
@rbfiles = Dir.glob("#{dir}/mrblib/*.rb")
@@ -113,9 +113,11 @@ __EOF__
obj_matcher = Regexp.new("^#{build_dir}/(.*)\\.o$")
{
'.c' => proc { |t| build.compile_c t.name, t.prerequisites.first, cflags },
- '.cpp' => proc { |t| build.compile_cxx t.name, t.prerequisites.first, cflags },
- '.m' => proc { |t| build.compile_objc t.name, t.prerequisites.first, cflags },
- '.S' => proc { |t| build.compile_asm t.name, t.prerequisites.first, cflags }
+ '.cpp' => proc { |t| build.compile_cxx t.name, t.prerequisites.first, cxxflags },
+ '.cxx' => proc { |t| build.compile_cxx t.name, t.prerequisites.first, cxxflags },
+ '.cc' => proc { |t| build.compile_cxx t.name, t.prerequisites.first, cxxflags },
+ '.m' => proc { |t| build.compile_objc t.name, t.prerequisites.first, objcflags },
+ '.S' => proc { |t| build.compile_asm t.name, t.prerequisites.first, asmflags }
}.each do |ext, compile|
rule obj_matcher => [
proc { |file|
@@ -147,7 +149,7 @@ __EOF__
build.compile_mruby f, rbfiles, "gem_mrblib_irep_#{funcname}" unless rbfiles.empty?
f.puts "void mrb_#{funcname}_gem_init(mrb_state *mrb);"
f.puts "void GENERATED_TMP_mrb_#{funcname}_gem_init(mrb_state *mrb) {"
- f.puts " mrb_#{funcname}_gem_init(mrb);" unless objs.empty?
+ f.puts " mrb_#{funcname}_gem_init(mrb);" if objs != ["#{build_dir}/gem_init.o"]
f.puts <<__EOF__ unless rbfiles.empty?
mrb_load_irep(mrb, gem_mrblib_irep_#{funcname});
if (mrb->exc) {
diff --git a/tasks/rules.rake b/tasks/rules.rake
index f53f3bccd..7d988cde3 100644
--- a/tasks/rules.rake
+++ b/tasks/rules.rake
@@ -12,6 +12,8 @@ MRuby.each_target do |t|
{
'.c' => proc { |t| compile_c t.name, t.prerequisites.first },
'.cpp' => proc { |t| compile_cxx t.name, t.prerequisites.first },
+ '.cxx' => proc { |t| compile_cxx t.name, t.prerequisites.first },
+ '.cc' => proc { |t| compile_cxx t.name, t.prerequisites.first },
'.m' => proc { |t| compile_objc t.name, t.prerequisites.first },
'.S' => proc { |t| compile_asm t.name, t.prerequisites.first }
}.each do |ext, compile|