mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Update build process for both host and cross compile.
This commit is contained in:
+9
-8
@@ -81,7 +81,8 @@ module MRuby
|
||||
@mrbc = Command::Mrbc.new(self)
|
||||
|
||||
@bins = []
|
||||
@gems, @libmruby_objs = MRuby::Gem::List.new, []
|
||||
@gems = MRuby::Gem::List.new
|
||||
@libmruby_objs = []
|
||||
@build_mrbtest_lib_only = false
|
||||
@cxx_exception_enabled = false
|
||||
@cxx_exception_disabled = false
|
||||
@@ -95,11 +96,10 @@ module MRuby
|
||||
MRuby.targets[@name] = self
|
||||
end
|
||||
|
||||
MRuby::Build.current = MRuby.targets[@name]
|
||||
MRuby.targets[@name].instance_eval(&block)
|
||||
|
||||
build_mrbc_exec if name == 'host'
|
||||
build_mrbtest if test_enabled?
|
||||
current = MRuby.targets[@name]
|
||||
MRuby::Build.current = current
|
||||
current.instance_eval(&block)
|
||||
current.build_mrbtest if current.test_enabled?
|
||||
end
|
||||
|
||||
def debug_enabled?
|
||||
@@ -247,8 +247,9 @@ EOS
|
||||
def mrbcfile
|
||||
return @mrbcfile if @mrbcfile
|
||||
|
||||
unless gems.detect { |v| v.name == 'mruby-bin-mrbc' }
|
||||
gem :core => "mruby-bin-mrbc"
|
||||
unless gems.detect {|v| v.name == 'mruby-bin-mrbc' }
|
||||
build_mrbc_exec
|
||||
gems.detect {|v| v.name == 'mruby-bin-mrbc' }.setup
|
||||
end
|
||||
@mrbcfile = self.exefile("#{self.build_dir}/bin/mrbc")
|
||||
end
|
||||
|
||||
@@ -28,18 +28,19 @@ module MRuby
|
||||
Gem.current = nil
|
||||
load gemrake
|
||||
return nil unless Gem.current
|
||||
current = Gem.current
|
||||
|
||||
Gem.current.dir = gemdir
|
||||
Gem.current.build = self.is_a?(MRuby::Build) ? self : MRuby::Build.current
|
||||
Gem.current.build_config_initializer = block
|
||||
gems << Gem.current
|
||||
current.dir = gemdir
|
||||
current.build = self.is_a?(MRuby::Build) ? self : MRuby::Build.current
|
||||
current.build_config_initializer = block
|
||||
gems << current
|
||||
|
||||
cxx_srcs = ['src', 'test', 'tools'].map do |subdir|
|
||||
Dir.glob("#{Gem.current.dir}/#{subdir}/*.{cpp,cxx,cc}")
|
||||
Dir.glob("#{current.dir}/#{subdir}/*.{cpp,cxx,cc}")
|
||||
end.flatten
|
||||
enable_cxx_exception unless cxx_srcs.empty?
|
||||
|
||||
Gem.current
|
||||
current
|
||||
end
|
||||
|
||||
def load_special_path_gem(params)
|
||||
|
||||
+3
-2
@@ -47,12 +47,14 @@ module MRuby
|
||||
@version = "0.0.0"
|
||||
@mrblib_dir = "mrblib"
|
||||
@objs_dir = "src"
|
||||
@dependencies = []
|
||||
@conflicts = []
|
||||
MRuby::Gem.current = self
|
||||
end
|
||||
|
||||
def setup
|
||||
return if defined?(@linker) # return if already set up
|
||||
|
||||
|
||||
MRuby::Gem.current = self
|
||||
MRuby::Build::COMMANDS.each do |command|
|
||||
instance_variable_set("@#{command}", @build.send(command).clone)
|
||||
@@ -75,7 +77,6 @@ module MRuby
|
||||
@bins = []
|
||||
|
||||
@requirements = []
|
||||
@dependencies, @conflicts = [], []
|
||||
@export_include_paths = []
|
||||
@export_include_paths << "#{dir}/include" if File.directory? "#{dir}/include"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user