Skip to content

Commit d8093fd

Browse files
committed
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
2 parents 7e3cb2e + 4771501 commit d8093fd

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

meson.build

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1513,7 +1513,9 @@ libgit_version_library = static_library('git-version',
15131513
'version.c',
15141514
version_def_h,
15151515
],
1516-
c_args: libgit_c_args,
1516+
c_args: libgit_c_args + [
1517+
'-DGIT_VERSION_H="' + version_def_h.full_path() + '"',
1518+
],
15171519
dependencies: libgit_dependencies,
15181520
include_directories: libgit_include_directories,
15191521
)

version.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
#include "git-compat-util.h"
22
#include "version.h"
3-
#include "version-def.h"
43
#include "strbuf.h"
54

5+
#ifndef GIT_VERSION_H
6+
# include "version-def.h"
7+
#else
8+
# include GIT_VERSION_H
9+
#endif
10+
611
const char git_version_string[] = GIT_VERSION;
712
const char git_built_from_commit_string[] = GIT_BUILT_FROM_COMMIT;
813

0 commit comments

Comments
 (0)