Skip to content

Commit 14c12bf

Browse files
committed
Extensively parallelize the build
1 parent 68bc124 commit 14c12bf

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

nob.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define RAYLIB_DIR THIRDPARTY_DIR"raylib-5.0_linux_amd64/"
1111

1212
Cmd cmd = {0};
13+
Procs procs = {0};
1314

1415
void cflags(void)
1516
{
@@ -51,7 +52,7 @@ bool build_plug_c(bool force, const char *source_path, const char *output_path)
5152
cmd_append(&cmd, "-o", output_path);
5253
cmd_append(&cmd, source_path);
5354
libs();
54-
return cmd_run(&cmd);
55+
return cmd_run(&cmd, .async = &procs);
5556
}
5657

5758
nob_log(INFO, "%s is up-to-date", output_path);
@@ -69,7 +70,7 @@ bool build_plug_cxx(bool force, const char *source_path, const char *output_path
6970
cmd_append(&cmd, "-o", output_path);
7071
cmd_append(&cmd, source_path);
7172
libs();
72-
return cmd_run(&cmd);
73+
return cmd_run(&cmd, .async = &procs);
7374
}
7475

7576
nob_log(INFO, "%s is up-to-date", output_path);
@@ -86,7 +87,7 @@ bool build_exe(bool force, const char **input_paths, size_t input_paths_len, con
8687
cmd_append(&cmd, "-o", output_path);
8788
da_append_many(&cmd, input_paths, input_paths_len);
8889
libs();
89-
return cmd_run(&cmd);
90+
return cmd_run(&cmd, .async = &procs);
9091
}
9192

9293
nob_log(INFO, "%s is up-to-date", output_path);
@@ -129,5 +130,7 @@ int main(int argc, char **argv)
129130
if (!build_exe(force, input_paths, input_paths_len, output_path)) return 1;
130131
}
131132

133+
if (!procs_flush(&procs)) return 1;
134+
132135
return 0;
133136
}

0 commit comments

Comments
 (0)