File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11local lm = require " luamake"
2+ local subprocess = require " bee.subprocess"
23
34lm .rootdir = lm .basedir
45
6+ local ok , process , errMsg = pcall (subprocess .spawn , {
7+ lm .os ~= " windows" and " git" or " C:\\ Program Files\\ Git\\ cmd\\ git.exe" ,
8+ " rev-parse" ,
9+ " HEAD" ,
10+ stdout = true ,
11+ })
12+ local commit
13+ if ok then
14+ if errMsg then
15+ print (" Failed to start git process: " .. errMsg )
16+ else
17+ local output = process .stdout :read " a"
18+ commit = output :match " ^%s*(.-)%s*$"
19+ process :wait ()
20+ print (" Hash version: " .. commit )
21+ end
22+ end
23+
524lm :source_set " soluna_src" {
625 sources = {
726 " src/*.c" ,
827 },
28+ defines = {
29+ commit and string.format (' SOLUNA_HASH_VERSION=\\ "%s\\ "' , commit ),
30+ },
931 includes = {
1032 " build" ,
1133 " 3rd/lua" ,
Original file line number Diff line number Diff line change 22#define soluna_version_h
33
44#define SOLUNA_API_VERSION 1
5- #define SOLUNA_HASH_VERSION "16fd5b12ef47b7cb3aba5869c83705f52ccd4645"
5+ #ifndef SOLUNA_HASH_VERSION
6+ #define SOLUNA_HASH_VERSION "dev"
7+ #endif
68
79#endif
You can’t perform that action at this time.
0 commit comments