diff options
author | cebtenzzre <cebtenzzre@gmail.com> | 2023-11-02 02:50:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-02 08:50:16 +0200 |
commit | b12fa0d1c13596869c512f49a526b979c94787cc (patch) | |
tree | 663ddc7bd68e32f219127839e0155a4acca21c53 /common/common.h | |
parent | 4d719a6d4e74b9a98e75f826f865f3153717d54b (diff) |
build : link against build info instead of compiling against it (#3879)
* cmake : fix build when .git does not exist
* cmake : simplify BUILD_INFO target
* cmake : add missing dependencies on BUILD_INFO
* build : link against build info instead of compiling against it
* zig : make build info a .cpp source instead of a header
Co-authored-by: Matheus C. França <matheus-catarino@hotmail.com>
* cmake : revert change to CMP0115
---------
Co-authored-by: Matheus C. França <matheus-catarino@hotmail.com>
Diffstat (limited to 'common/common.h')
-rw-r--r-- | common/common.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/common/common.h b/common/common.h index 7be69f92..72a49b89 100644 --- a/common/common.h +++ b/common/common.h @@ -26,11 +26,17 @@ #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); \ +#define print_build_info() do { \ + fprintf(stderr, "%s: build = %d (%s)\n", __func__, LLAMA_BUILD_NUMBER, LLAMA_COMMIT); \ + fprintf(stderr, "%s: built with %s for %s\n", __func__, LLAMA_COMPILER, LLAMA_BUILD_TARGET); \ } while(0) +// build info +extern int LLAMA_BUILD_NUMBER; +extern char const *LLAMA_COMMIT; +extern char const *LLAMA_COMPILER; +extern char const *LLAMA_BUILD_TARGET; + // // CLI argument parsing // |