aboutsummaryrefslogtreecommitdiff
path: root/src/link.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-04-19 14:00:12 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-04-19 14:00:12 -0400
commitd1e01e43d3b2078bfb07defb693d819e99eaa6c5 (patch)
treeee5a96ae18383a89b62533c9aada1d867a485959 /src/link.cpp
parent666435195fff867417f92e1b4f8ef7e0608470ee (diff)
downloadzig-d1e01e43d3b2078bfb07defb693d819e99eaa6c5.tar.gz
zig-d1e01e43d3b2078bfb07defb693d819e99eaa6c5.zip
convert assemble and link tests to zig build system
Diffstat (limited to 'src/link.cpp')
-rw-r--r--src/link.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/link.cpp b/src/link.cpp
index edf5243b40..5c73c2134e 100644
--- a/src/link.cpp
+++ b/src/link.cpp
@@ -770,6 +770,14 @@ void codegen_link(CodeGen *g, const char *out_file) {
if (g->want_h_file) {
codegen_generate_h_file(g);
}
+ if (override_out_file) {
+ assert(g->link_objects.length == 1);
+ Buf *o_file_path = g->link_objects.at(0);
+ int err;
+ if ((err = os_rename(o_file_path, &lj.out_file))) {
+ zig_panic("unable to rename object file into final output: %s", err_str(err));
+ }
+ }
if (g->verbose) {
fprintf(stderr, "OK\n");
}