diff options
Diffstat (limited to 'b.c')
-rw-r--r-- | b.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -24,12 +24,14 @@ void libs(B_Cmd *cmd) b_cmd_append(cmd, "-lSDL2", "-lm", "-lvulkan", "-lshaderc_shared", "-lstdc++"); } -bool build_exe(bool force, B_Cmd *cmd, const char **input_paths, size_t input_paths_len, const char *output_path) +bool build_exe(bool force, B_Cmd *cmd, const char **input_paths, size_t input_paths_len, const char **dep_paths, size_t dep_paths_len, const char *output_path) { int rebuild_is_needed = b_needs_rebuild(output_path, input_paths, input_paths_len); - if (rebuild_is_needed < 0) return false; + int dep_rebuild = b_needs_rebuild(output_path, dep_paths, dep_paths_len); + + if (rebuild_is_needed < 0 || dep_rebuild < 0) return false; - if (force || rebuild_is_needed) { + if (force || rebuild_is_needed || dep_rebuild) { cmd->count = 0; cc(cmd); b_cmd_append(cmd, "-o", output_path); @@ -61,13 +63,17 @@ main(int argc, char *argv[]) } } + const char *dep_paths[] = { + "src/state.h", + "src/vksetup.h", + }; const char *input_paths[] = { "src/render.c", "src/cplusplus.cpp" }; B_Cmd cmd = {0}; - if (!build_exe(force, &cmd, input_paths, B_ARRAY_LEN(input_paths), "render")) return 1; + if (!build_exe(force, &cmd, input_paths, B_ARRAY_LEN(input_paths), dep_paths, B_ARRAY_LEN(dep_paths),"render")) return 1; return 0; } |