Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,22 @@ genrule(
name = "StaConfig",
srcs = [],
outs = ["include/sta/StaConfig.hh"],
cmd = """echo -e '
#pragma once
#define STA_VERSION "2.7.0"
#define STA_GIT_SHA1 "f21d4a3878e2531e3af4930818d9b5968aad9416"
#define SSTA 0
#define ZLIB_FOUND' > \"$@\"
cmd = """
SHA1=""
if [ -f bazel-out/stable-status.txt ]; then
SHA1=$$(grep '^STABLE_STA_GIT_SHA1 ' bazel-out/stable-status.txt \
| cut -d' ' -f2-) || true
fi
[ -z "$$SHA1" ] && SHA1="unknown"
printf '#pragma once\\n' > $@
printf '#define STA_VERSION "3.0.0"\\n' >> $@
printf '#define STA_GIT_SHA1 "%s"\\n' "$$SHA1" >> $@
printf '#define SSTA 0\\n' >> $@
printf '#define ZLIB_FOUND\\n' >> $@
""",
# stamp = -1: only stamps with --stamp (or --config=release).
# Without --stamp, STA_GIT_SHA1 will be "unknown".
stamp = -1,
visibility = ["//:__subpackages__"],
)

Expand Down