diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-02-17 21:05:46 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-02-17 21:05:46 -0700 |
| commit | e5982e44406e6d00904df861f95c0ce6678d3273 (patch) | |
| tree | 74b3778c984f98918be4407677b260a73d02037f /src/link.cpp | |
| parent | 04cc59be65d525dc2f3cb4585e1ec2d47473b461 (diff) | |
| download | zig-e5982e44406e6d00904df861f95c0ce6678d3273.tar.gz zig-e5982e44406e6d00904df861f95c0ce6678d3273.zip | |
link: on windows link test runner and builtin o files
Diffstat (limited to 'src/link.cpp')
| -rw-r--r-- | src/link.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/link.cpp b/src/link.cpp index 0f8a576d97..d58ecd0a12 100644 --- a/src/link.cpp +++ b/src/link.cpp @@ -356,6 +356,21 @@ static void construct_linker_job_mingw(LinkJob *lj) { lj->args.append((const char *)buf_ptr(&lj->out_file_o)); + if (g->is_test_build) { + 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); + lj->args.append(buf_ptr(test_runner_o_path)); + } + + if (!g->link_libc && (g->out_type == OutTypeExe || g->out_type == OutTypeLib)) { + Buf *builtin_o_path = build_o(g, "builtin"); + lj->args.append(buf_ptr(builtin_o_path)); + + Buf *compiler_rt_o_path = build_o(g, "compiler_rt"); + lj->args.append(buf_ptr(compiler_rt_o_path)); + } + + for (int i = 0; i < g->link_libs.length; i += 1) { Buf *link_lib = g->link_libs.at(i); Buf *arg = buf_sprintf("-l%s", buf_ptr(link_lib)); |
