diff options
author | Cebtenzzre <cebtenzzre@gmail.com> | 2023-09-15 16:59:49 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-15 16:59:49 -0400 |
commit | e6616cf0db2b63189fc34d0076f654af9adecdf8 (patch) | |
tree | 5a5d518c2e576972ee097297ed1551b66880914b /common/common.h | |
parent | 3aefaab9e59335ebb07d5205dbc8633efd680e58 (diff) |
examples : add compiler version and target to build info (#2998)
Diffstat (limited to 'common/common.h')
-rw-r--r-- | common/common.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/common/common.h b/common/common.h index 37d15415..f9dfd4a2 100644 --- a/common/common.h +++ b/common/common.h @@ -3,6 +3,7 @@ #pragma once #include "llama.h" +#include "build-info.h" #define LOG_NO_FILE_LINE_FUNCTION #include "log.h" @@ -23,6 +24,11 @@ #define die(msg) do { fputs("error: " msg "\n", stderr); exit(1); } while (0) #define die_fmt(fmt, ...) do { fprintf(stderr, "error: " fmt "\n", __VA_ARGS__); exit(1); } while (0) +#define print_build_info() do { \ + fprintf(stderr, "%s: build = %d (%s)\n", __func__, BUILD_NUMBER, BUILD_COMMIT); \ + fprintf(stderr, "%s: built with %s for %s\n", __func__, BUILD_COMPILER, BUILD_TARGET); \ +} while(0) + // // CLI argument parsing // |