aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorkuvaus <22169537+kuvaus@users.noreply.github.com>2023-05-03 03:43:43 +0300
committerGitHub <noreply@github.com>2023-05-03 02:43:43 +0200
commit9daff419f6be818595ddbea293a0ea7283af726e (patch)
tree1772ef86f0736104b252d38af9f46da1efd76f60 /scripts
parentbf4b22ffe433dc5e2fba7588c4485a7e51b1a30d (diff)
fix build-info.h for git submodules (#1289)
* make git build info work with submodules --------- Co-authored-by: Green Sky <green@g-s.xyz>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build-info.cmake2
-rw-r--r--scripts/build-info.h.in7
2 files changed, 8 insertions, 1 deletions
diff --git a/scripts/build-info.cmake b/scripts/build-info.cmake
index fb46ed2..5023b77 100644
--- a/scripts/build-info.cmake
+++ b/scripts/build-info.cmake
@@ -1,4 +1,4 @@
-set(TEMPLATE_FILE "${CMAKE_BINARY_DIR}/BUILD_INFO.h.in")
+set(TEMPLATE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/scripts/build-info.h.in")
set(HEADER_FILE "${CMAKE_CURRENT_SOURCE_DIR}/build-info.h")
set(BUILD_NUMBER 0)
set(BUILD_COMMIT "unknown")
diff --git a/scripts/build-info.h.in b/scripts/build-info.h.in
new file mode 100644
index 0000000..75d1e16
--- /dev/null
+++ b/scripts/build-info.h.in
@@ -0,0 +1,7 @@
+#ifndef BUILD_INFO_H
+#define BUILD_INFO_H
+
+#define BUILD_NUMBER @BUILD_NUMBER@
+#define BUILD_COMMIT "@BUILD_COMMIT@"
+
+#endif // BUILD_INFO_H