diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-05-13 12:15:55 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-05-13 12:15:55 -0400 |
| commit | 7330a6102f7a8108ee364b9de79efe4a70049167 (patch) | |
| tree | 5b695c1cc8f10d1d153411d5ee6ff0ddf7e56dc2 /src/codegen.cpp | |
| parent | f3db3b3c1319e2e86bf5eabd2c2eaef58e4dd783 (diff) | |
| download | zig-7330a6102f7a8108ee364b9de79efe4a70049167.tar.gz zig-7330a6102f7a8108ee364b9de79efe4a70049167.zip | |
cache_add_dep_file: handle ErrorFileNotFound specially
Diffstat (limited to 'src/codegen.cpp')
| -rw-r--r-- | src/codegen.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp index feb3cae95a..4529abcc83 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -8732,12 +8732,14 @@ static void gen_c_object(CodeGen *g, Buf *self_exe_path, CFile *c_file) { if ((err = cache_add_dep_file(cache_hash, out_dep_path, true))) { // Don't treat the absence of the .d file as a fatal error, the // compiler may not produce one eg. when compiling .s files - if (err != ErrorReadingDepFile) { + if (err != ErrorFileNotFound) { fprintf(stderr, "Failed to add C source dependencies to cache: %s\n", err_str(err)); exit(1); } } - os_delete_file(out_dep_path); + if (err != ErrorFileNotFound) { + os_delete_file(out_dep_path); + } if ((err = cache_final(cache_hash, &digest))) { fprintf(stderr, "Unable to finalize cache hash: %s\n", err_str(err)); |
