aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/common/66 vcstag
diff options
context:
space:
mode:
authorAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
committerAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
commitaf1a266670d040d2f4083ff309d732d648afba2a (patch)
tree2fc46203448ddcc6f81546d379abfaeb323575e9 /meson/test cases/common/66 vcstag
parente02cda008591317b1625707ff8e115a4841aa889 (diff)
Add submodule dependency filesHEADmaster
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'meson/test cases/common/66 vcstag')
-rw-r--r--meson/test cases/common/66 vcstag/meson.build18
-rw-r--r--meson/test cases/common/66 vcstag/tagprog.c9
-rw-r--r--meson/test cases/common/66 vcstag/vcstag.c.in2
3 files changed, 29 insertions, 0 deletions
diff --git a/meson/test cases/common/66 vcstag/meson.build b/meson/test cases/common/66 vcstag/meson.build
new file mode 100644
index 000000000..7e5983aaa
--- /dev/null
+++ b/meson/test cases/common/66 vcstag/meson.build
@@ -0,0 +1,18 @@
+project('vcstag', 'c')
+
+version_src = vcs_tag(input : 'vcstag.c.in',
+output : 'vcstag.c',
+fallback : '1.0.0')
+
+version_src_custom = vcs_tag(input : 'vcstag.c.in',
+output : 'vcstag-custom.c',
+command : ['git', 'show-ref', '-s', 'refs/heads/master'],
+fallback : '1.0.0')
+
+version_src_fallback = vcs_tag(input : 'vcstag.c.in',
+output : 'vcstag-fallback.c')
+
+executable('tagprog', 'tagprog.c', version_src)
+executable('tagprog-custom', 'tagprog.c', version_src_custom)
+executable('tagprog-fallback', 'tagprog.c', version_src_fallback)
+
diff --git a/meson/test cases/common/66 vcstag/tagprog.c b/meson/test cases/common/66 vcstag/tagprog.c
new file mode 100644
index 000000000..27c3cc58d
--- /dev/null
+++ b/meson/test cases/common/66 vcstag/tagprog.c
@@ -0,0 +1,9 @@
+#include<stdio.h>
+
+extern const char *vcstag;
+
+int main(void) {
+ printf("Version is %s\n", vcstag);
+ return 0;
+}
+
diff --git a/meson/test cases/common/66 vcstag/vcstag.c.in b/meson/test cases/common/66 vcstag/vcstag.c.in
new file mode 100644
index 000000000..09192d90d
--- /dev/null
+++ b/meson/test cases/common/66 vcstag/vcstag.c.in
@@ -0,0 +1,2 @@
+const char *vcstag = "@VCS_TAG@";
+