diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-02-28 02:00:20 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-02-28 14:51:56 -0500 |
| commit | d45ea4d89d7232fc4bcf56a5e088d7d6b5004ebb (patch) | |
| tree | 9111983824c5bb0bf2eb6481b3dcdfc52a632271 /src/main.cpp | |
| parent | 3683ba87ac5e5dfb6ea65c21c9fb714ed0582124 (diff) | |
| download | zig-d45ea4d89d7232fc4bcf56a5e088d7d6b5004ebb.tar.gz zig-d45ea4d89d7232fc4bcf56a5e088d7d6b5004ebb.zip | |
stage1: make get_native_target go through self-hosted
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index 11612402ee..f741cafd40 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -500,7 +500,10 @@ static int main0(int argc, char **argv) { os_path_join(get_zig_special_dir(zig_lib_dir), buf_create_from_str("build_runner.zig"), build_runner_path); ZigTarget target; - get_native_target(&target); + if ((err = target_parse_triple(&target, "native", nullptr))) { + fprintf(stderr, "Unable to get native target: %s\n", err_str(err)); + return EXIT_FAILURE; + } Buf *build_file_buf = buf_create_from_str((build_file != nullptr) ? build_file : "build.zig"); Buf build_file_abs = os_path_resolve(&build_file_buf, 1); @@ -1337,7 +1340,10 @@ static int main0(int argc, char **argv) { return main_exit(root_progress_node, EXIT_SUCCESS); } else if (cmd == CmdTest) { ZigTarget native; - get_native_target(&native); + if ((err = target_parse_triple(&native, "native", nullptr))) { + fprintf(stderr, "Unable to get native target: %s\n", err_str(err)); + return EXIT_FAILURE; + } g->enable_cache = get_cache_opt(enable_cache, output_dir == nullptr); codegen_build_and_link(g); |
