diff options
author | gramanas <anastasis.gramm2@gmail.com> | 2024-06-04 15:50:06 +0300 |
---|---|---|
committer | gramanas <anastasis.gramm2@gmail.com> | 2024-06-04 15:50:06 +0300 |
commit | e3c514f1c279c9955cac6b1fa9d0ede6ecbc310d (patch) | |
tree | 18397e00e96efb08853d676f8015ba95b1182db2 /b.c | |
parent | 64617ea2c46d13cd2f72df72fcd426d2fc561bff (diff) | |
download | cgame-e3c514f1c279c9955cac6b1fa9d0ede6ecbc310d.tar.gz cgame-e3c514f1c279c9955cac6b1fa9d0ede6ecbc310d.tar.bz2 cgame-e3c514f1c279c9955cac6b1fa9d0ede6ecbc310d.zip |
vks work and clang-format
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; } |