configure: fix handling build_dir and prefix options
This commit is contained in:
1 parent
1ecce7e99e
commit
0e27e967d0
3 files changed
+8
-10
No files matched your search
@@ -18,8 +18,6 @@ module Rscons
|
||||
def initialize
|
||||
@n_threads = determine_n_threads
|
||||
@vars = VarSet.new
|
||||
@build_dir = "build"
|
||||
@prefix = "/usr/local"
|
||||
end
|
||||
|
||||
# Run the specified operation.
|
||||
@@ -78,6 +76,9 @@ module Rscons
|
||||
#
|
||||
# @return [void]
|
||||
def configure(options)
|
||||
# Default options.
|
||||
options[:build_dir] ||= "build"
|
||||
options[:prefix] ||= "/usr/local"
|
||||
cache = Cache.instance
|
||||
cache.configuration_data = {}
|
||||
if project_name = @script.project_name
|
||||
@@ -85,9 +86,10 @@ module Rscons
|
||||
else
|
||||
$stdout.puts "Configuring project..."
|
||||
end
|
||||
Ansi.write($stdout, "Setting build directory... ", :green, @build_dir, :reset, "\n")
|
||||
Ansi.write($stdout, "Setting build directory... ", :green, options[:build_dir], :reset, "\n")
|
||||
Ansi.write($stdout, "Setting prefix... ", :green, options[:prefix], :reset, "\n")
|
||||
rv = 0
|
||||
co = ConfigureOp.new("#{@build_dir}/configure")
|
||||
co = ConfigureOp.new("#{options[:build_dir]}/configure")
|
||||
begin
|
||||
@script.configure(co)
|
||||
rescue ConfigureOp::ConfigureFailure
|
||||
|
||||
+1
-4
@@ -125,10 +125,7 @@ module Rscons
|
||||
end
|
||||
|
||||
def parse_configure_args(argv)
|
||||
options = {
|
||||
build_dir: "build",
|
||||
prefix: "/usr/local",
|
||||
}
|
||||
options = {}
|
||||
OptionParser.new do |opts|
|
||||
opts.banner = "Usage: #{$0} [options]"
|
||||
|
||||
|
||||
Reference in new issue
Block a user