Fix #5177 - set MRUBY_CONFIG early

parent 39a11f32
...@@ -14,7 +14,8 @@ require "mruby/core_ext" ...@@ -14,7 +14,8 @@ require "mruby/core_ext"
require "mruby/build" require "mruby/build"
# load configuration file # load configuration file
MRUBY_CONFIG = MRuby::Build.load_config MRUBY_CONFIG = MRuby::Build.mruby_config_path
load MRUBY_CONFIG
# load basic rules # load basic rules
MRuby.each_target do |build| MRuby.each_target do |build|
......
...@@ -39,7 +39,7 @@ module MRuby ...@@ -39,7 +39,7 @@ module MRuby
class Build class Build
class << self class << self
attr_accessor :current attr_accessor :current
def load_config def mruby_config_path
path = ENV['MRUBY_CONFIG'] || ENV['CONFIG'] path = ENV['MRUBY_CONFIG'] || ENV['CONFIG']
if path.nil? || path.empty? if path.nil? || path.empty?
path = "#{MRUBY_ROOT}/build_config/default.rb" path = "#{MRUBY_ROOT}/build_config/default.rb"
...@@ -47,7 +47,6 @@ module MRuby ...@@ -47,7 +47,6 @@ module MRuby
f = "#{MRUBY_ROOT}/build_config/#{path}.rb" f = "#{MRUBY_ROOT}/build_config/#{path}.rb"
path = File.exist?(f) ? f : File.extname(path).empty? ? f : path path = File.exist?(f) ? f : File.extname(path).empty? ? f : path
end end
load path
path path
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment