Skip to content

Commit fb77e5e

Browse files
committed
Use nob_cmd_run_sync_and_reset everywhere
1 parent b8bf1c5 commit fb77e5e

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

nob.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ bool build_plug_c3(bool force, Nob_Cmd *cmd, const char *output_path, const char
4040
int rebuild_is_needed = nob_needs_rebuild(nob_temp_sprintf("%s.so", output_path), source_paths, source_paths_count);
4141
if (rebuild_is_needed < 0) return false;
4242
if (force || rebuild_is_needed) {
43-
cmd->count = 0;
4443
// TODO: check if c3c compile even exists
4544
// otherwise this is not buildable
4645
nob_cmd_append(cmd, "c3c", "dynamic-lib", "-o", output_path);
@@ -57,13 +56,12 @@ bool build_plug_c(bool force, Nob_Cmd *cmd, const char *source_path, const char
5756
if (rebuild_is_needed < 0) return false;
5857

5958
if (force || rebuild_is_needed) {
60-
cmd->count = 0;
6159
cc(cmd);
6260
nob_cmd_append(cmd, "-fPIC", "-shared", "-Wl,--no-undefined");
6361
nob_cmd_append(cmd, "-o", output_path);
6462
nob_cmd_append(cmd, source_path);
6563
libs(cmd);
66-
return nob_cmd_run_sync(*cmd);
64+
return nob_cmd_run_sync_and_reset(cmd);
6765
}
6866

6967
nob_log(NOB_INFO, "%s is up-to-date", output_path);
@@ -76,13 +74,12 @@ bool build_plug_cxx(bool force, Nob_Cmd *cmd, const char *source_path, const cha
7674
if (rebuild_is_needed < 0) return false;
7775

7876
if (force || rebuild_is_needed) {
79-
cmd->count = 0;
8077
cxx(cmd);
8178
nob_cmd_append(cmd, "-fPIC", "-shared", "-Wl,--no-undefined");
8279
nob_cmd_append(cmd, "-o", output_path);
8380
nob_cmd_append(cmd, source_path);
8481
libs(cmd);
85-
return nob_cmd_run_sync(*cmd);
82+
return nob_cmd_run_sync_and_reset(cmd);
8683
}
8784

8885
nob_log(NOB_INFO, "%s is up-to-date", output_path);
@@ -95,12 +92,11 @@ bool build_exe(bool force, Nob_Cmd *cmd, const char **input_paths, size_t input_
9592
if (rebuild_is_needed < 0) return false;
9693

9794
if (force || rebuild_is_needed) {
98-
cmd->count = 0;
9995
cc(cmd);
10096
nob_cmd_append(cmd, "-o", output_path);
10197
nob_da_append_many(cmd, input_paths, input_paths_len);
10298
libs(cmd);
103-
return nob_cmd_run_sync(*cmd);
99+
return nob_cmd_run_sync_and_reset(cmd);
104100
}
105101

106102
nob_log(NOB_INFO, "%s is up-to-date", output_path);

0 commit comments

Comments
 (0)