aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/build/script/script.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-11-20 22:07:37 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-12-02 17:31:04 +0300
commit0ff39fd77b3127c7a250e7f817e34dfaecbcc208 (patch)
treeedb20351f3d44558201b5668823c191a8722d3a5 /libbuild2/build/script/script.cxx
parent41a6f8b7d3036708f36ea1b5bd5b8d4289428fe5 (diff)
Add support for buildscript depdb preamble
Diffstat (limited to 'libbuild2/build/script/script.cxx')
-rw-r--r--libbuild2/build/script/script.cxx17
1 files changed, 12 insertions, 5 deletions
diff --git a/libbuild2/build/script/script.cxx b/libbuild2/build/script/script.cxx
index c6b57c3..e003b6a 100644
--- a/libbuild2/build/script/script.cxx
+++ b/libbuild2/build/script/script.cxx
@@ -74,13 +74,20 @@ namespace build2
assign (var_pool.insert ("<")) = move (ns);
}
- // Set the $~ special variable.
- //
if (temp)
- {
+ set_temp_dir_variable ();
+ }
+
+ void environment::
+ set_temp_dir_variable ()
+ {
+ // Note that the temporary directory could have been created
+ // implicitly by the runner.
+ //
+ if (temp_dir.path.empty ())
create_temp_dir ();
- assign (var_pool.insert<dir_path> ("~")) = temp_dir.path;
- }
+
+ assign (var_pool.insert<dir_path> ("~")) = temp_dir.path;
}
void environment::