Skip to content

Commit

Permalink
Add method toolchains and primary_toolchain to MRuby::Build.
Browse files Browse the repository at this point in the history
* To check imported toolchains for setting up toolchain specific things.
* `primary_toolchain` returns the main toolchain name of the build.
  • Loading branch information
take-cheeze committed Jun 29, 2014
1 parent 618ef17 commit ef57fd5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tasks/mruby_build.rake
Expand Up @@ -44,7 +44,7 @@ module MRuby
include Rake::DSL
include LoadGems
attr_accessor :name, :bins, :exts, :file_separator, :build_dir, :gem_clone_dir
attr_reader :libmruby, :gems
attr_reader :libmruby, :gems, :toolchains
attr_writer :enable_bintest

COMPILERS = %w(cc cxx objc asm)
Expand Down Expand Up @@ -84,6 +84,7 @@ module MRuby
@build_mrbtest_lib_only = false
@cxx_abi_enabled = false
@cxx_exception_disabled = false
@toolchains = []

MRuby.targets[@name] = self
end
Expand Down Expand Up @@ -124,6 +125,11 @@ module MRuby
tc = Toolchain.toolchains[name.to_s]
fail "Unknown #{name} toolchain" unless tc
tc.setup(self)
@toolchains.unshift name.to_s
end

def primary_toolchain
@toolchains.first
end

def root
Expand Down

0 comments on commit ef57fd5

Please sign in to comment.