aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/build/script/script.cxx
diff options
context:
space:
mode:
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::