diff options
author | gramanas <anastasis.gramm2@gmail.com> | 2024-06-06 13:41:08 +0300 |
---|---|---|
committer | gramanas <anastasis.gramm2@gmail.com> | 2024-06-06 13:41:08 +0300 |
commit | eb5d40f92c6d2d1d7491c350cbdcef2e8bf96e06 (patch) | |
tree | afe523416d2cd5c57f403dd5a36d28a9c513ed30 /src/b.h | |
parent | a6501b5d7ad204c3b998c843c7ed68ef7be323ba (diff) | |
download | cgame-eb5d40f92c6d2d1d7491c350cbdcef2e8bf96e06.tar.gz cgame-eb5d40f92c6d2d1d7491c350cbdcef2e8bf96e06.tar.bz2 cgame-eb5d40f92c6d2d1d7491c350cbdcef2e8bf96e06.zip |
build changes
Diffstat (limited to 'src/b.h')
-rw-r--r-- | src/b.h | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -49,6 +49,8 @@ typedef enum { B_INFO, + B_CMD, + B_BUILDING, B_CHANGE, B_WARNING, B_ERROR, @@ -306,7 +308,7 @@ bool b_mkdir_if_not_exists(const char *path) int result = mkdir(path, 0755); if (result < 0) { if (errno == EEXIST) { - b_log(B_INFO, "directory `%s` already exists", path); + //b_log(B_INFO, "directory `%s` already exists", path); return true; } b_log(B_ERROR, "could not create directory `%s`: %s", path, strerror(errno)); @@ -398,7 +400,7 @@ B_Proc b_cmd_run_async(B_Cmd cmd) B_String_Builder sb = {0}; b_cmd_render(cmd, &sb); b_sb_append_null(&sb); - b_log(B_INFO, "CMD: %s", sb.items); + b_log(B_CMD, "%s", sb.items); b_sb_free(sb); memset(&sb, 0, sizeof(sb)); @@ -486,6 +488,12 @@ void b_log(B_Log_Level level, const char *fmt, ...) case B_INFO: fprintf(stderr, "[INFO] "); break; + case B_CMD: + fprintf(stderr, "[CMD] "); + break; + case B_BUILDING: + fprintf(stderr, "[BUILDING] "); + break; case B_CHANGE: fprintf(stderr, "[CHANGE] "); break; @@ -712,7 +720,10 @@ int b_needs_rebuild(const char *output_path, const char **input_paths, size_t in if (stat(output_path, &statbuf) < 0) { // NOTE: if output does not exist it 100% must be rebuilt - if (errno == ENOENT) return 1; + if (errno == ENOENT) { + b_log(B_BUILDING, "%s", output_path); + return 1; + } b_log(B_ERROR, "could not stat %s: %s", output_path, strerror(errno)); return -1; } |