Merge branch 'tc/meson-use-our-version-def-h'

The meson build procedure looked for the 'version-def.h' file in a
wrong directory, which has been corrected.

* tc/meson-use-our-version-def-h:
  meson: ensure correct version-def.h is used
maint
Junio C Hamano 2025-01-23 15:07:01 -08:00
commit d8093fd6c1
2 changed files with 9 additions and 2 deletions

View File

@ -1513,7 +1513,9 @@ libgit_version_library = static_library('git-version',
'version.c',
version_def_h,
],
c_args: libgit_c_args,
c_args: libgit_c_args + [
'-DGIT_VERSION_H="' + version_def_h.full_path() + '"',
],
dependencies: libgit_dependencies,
include_directories: libgit_include_directories,
)

View File

@ -1,8 +1,13 @@
#include "git-compat-util.h"
#include "version.h"
#include "version-def.h"
#include "strbuf.h"

#ifndef GIT_VERSION_H
# include "version-def.h"
#else
# include GIT_VERSION_H
#endif

const char git_version_string[] = GIT_VERSION;
const char git_built_from_commit_string[] = GIT_BUILT_FROM_COMMIT;