support command-line variables - close #51

This commit is contained in:
josh committed 2018-08-23 14:58:08 -04:00
1 parent d081a4695f
commit 284312a21c
4 files changed
+22 -10

No files matched your search

+6
View File
@@ -55,6 +55,11 @@ module Rscons
# Whether to output ANSI color escape sequences.
attr_accessor :do_ansi_color
# @since 1.16.0
# @return [VarSet]
# Access any variables set on the rscons command-line.
attr_reader :vars
# Remove all generated files.
#
# @return [void]
@@ -232,6 +237,7 @@ module Rscons
end
@n_threads = determine_n_threads
@vars = VarSet.new
end
+6
View File
@@ -60,6 +60,12 @@ module Rscons
end.parse!(argv)
argv.each do |arg|
if arg =~ /^([^=]+)=(.*)$/
Rscons.vars[$1] = $2
end
end
if rsconsfile
unless File.exists?(rsconsfile)
$stderr.puts "Cannot read #{rsconsfile}"