diff options
| author | Stefan Boberg <[email protected]> | 2021-10-05 22:25:53 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-10-05 22:25:53 +0200 |
| commit | 20ac7384f8ca558f1fb933eda846604792240ea0 (patch) | |
| tree | e5c95b422b847af50b77807af916e389fcaf83aa /zenserver/xmake.lua | |
| parent | stats: Mean returns zero when the count is zero (diff) | |
| download | zen-20ac7384f8ca558f1fb933eda846604792240ea0.tar.xz zen-20ac7384f8ca558f1fb933eda846604792240ea0.zip | |
Merged from upstream
Diffstat (limited to 'zenserver/xmake.lua')
| -rw-r--r-- | zenserver/xmake.lua | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/zenserver/xmake.lua b/zenserver/xmake.lua index 7a6981fcd..fb1ba651d 100644 --- a/zenserver/xmake.lua +++ b/zenserver/xmake.lua @@ -32,3 +32,18 @@ target("zenserver") add_packages( "vcpkg::cxxopts", "vcpkg::mimalloc") + + on_load(function(target) + local commit, err = os.iorun("git log -1 --format=\"%h-%cI\"") + if commit ~= nil then + commit = commit:gsub("%s+", "") + commit = commit:gsub("\n", "") + if is_mode("release") then + commit = "rel-" .. commit + else + commit = "dbg-" .. commit + end + target:add("defines","BUILD_VERSION=\"" .. commit .. "\"") + print("build version " .. commit) + end + end) |