Make all variables in root target file available to ninja commands

Ideally we would have a section with “public” variables, but that will require making the format more complex, so for now, everything gets declared as a variable in the ninja build file, even though for now, we really just need to export APP_MIN_OS.
This commit is contained in:
Allan Odgaard
2019-06-29 15:05:48 +02:00
parent 6a8eb992fc
commit 260fad0c3f

View File

@@ -381,9 +381,11 @@ SHELL
end
def to_s
width = @variables.map { |key, value| key.length }.max { |lhs, rhs| lhs <=> rhs }
res = @variables.map { |key, value| format("%-#{width}s = %s\n", key, value) }.join
res << "\n" unless @variables.empty?
variables = @context.to_h.merge(@variables)
width = variables.map { |key, value| key.length }.max { |lhs, rhs| lhs <=> rhs }
res = variables.map { |key, value| format("%-#{width}s = %s\n", key, value) }.join
res << "\n" unless variables.empty?
@rules.map do |name, values|
flags = values.map { |k, v| " #{k} = #{v}" }.join("\n")