rscons/build_tests/simple/absolute_source_path.rb
Josh Holtrop ef7e9259cb Add shortcut method for creating environments - close #149
Add env() method to create environments.
Process all environments created at build script top level before
executing any autoconf-enabled tasks, or if no tasks are specified by
the user.
2022-02-12 21:59:52 -05:00

14 lines
279 B
Ruby

env(echo: :command) do |env|
tempdir = ENV["TEMP"] || ENV["TMP"] || "/tmp"
source_file = File.join(tempdir, "abs.c")
File.open(source_file, "w") do |fh|
fh.puts(<<-EOF)
int main()
{
return 29;
}
EOF
end
env.Program("abs.exe", source_file)
end