aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-02-03 23:07:55 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-02-03 23:07:55 -0700
commita6d43352175ac49ee180592055d56101fe20b83a (patch)
tree856e068887477d3b6cb07e97bd66f14182230bbd /src/codegen.cpp
parent2521afef699d40917db906ebb27a87c5ea287fbe (diff)
downloadzig-a6d43352175ac49ee180592055d56101fe20b83a.tar.gz
zig-a6d43352175ac49ee180592055d56101fe20b83a.zip
fix running tests when linking with libc
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index cfae4da2a1..ba72aa69d8 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -3847,6 +3847,8 @@ static Buf *build_o(CodeGen *parent_gen, const char *oname) {
Buf *std_dir_path = buf_create_from_str(ZIG_STD_DIR);
CodeGen *child_gen = codegen_create(std_dir_path);
+ child_gen->link_libc = parent_gen->link_libc;
+
codegen_set_is_release(child_gen, parent_gen->is_release_build);
codegen_set_strip(child_gen, parent_gen->strip_debug_symbols);
@@ -3978,7 +3980,8 @@ void codegen_link(CodeGen *g, const char *out_file) {
}
if (g->is_test_build) {
- Buf *test_runner_o_path = build_o(g, "test_runner");
+ const char *test_runner_name = g->link_libc ? "test_runner_libc" : "test_runner_nolibc";
+ Buf *test_runner_o_path = build_o(g, test_runner_name);
args.append(buf_ptr(test_runner_o_path));
}