Skip to content

Commit

Permalink
chore: Use mkstamp macro to get git version from bazel build.
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Dec 4, 2024
1 parent 9c5bfab commit c6ad6a8
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
load("@rules_cc//cc:defs.bzl", "cc_library", "objc_library")
load("//third_party/qt:build_defs.bzl", "qt_moc", "qt_uic")

VERSION = "1.16.3"
load("//tools/project:build_defs.bzl", "mkstamp")

DEFINES = [
"DEBUG",
Expand Down Expand Up @@ -157,15 +156,9 @@ objc_library(
deps = ["@qt//:qt_core"],
)

genrule(
mkstamp(
name = "version",
outs = ["version.h"],
cmd = """cat <<EOF > $@
#define GIT_DESCRIBE "v%s"
#define GIT_DESCRIBE_EXACT "v%s"
#define GIT_VERSION "master"
#define TIMESTAMP "redacted"
EOF""" % (VERSION, VERSION),
hdr = "version.h",
)

cc_library(
Expand Down

0 comments on commit c6ad6a8

Please sign in to comment.