File tree Expand file tree Collapse file tree 4 files changed +31
-1
lines changed Expand file tree Collapse file tree 4 files changed +31
-1
lines changed Original file line number Diff line number Diff line change 11Bootstrap.bat text eol =crlf
2+ git-tags.txt export-subst
Original file line number Diff line number Diff line change 1+ $Format:%(describe:tags=true)$
Original file line number Diff line number Diff line change 192192-- symbols "On"
193193--
194194
195+ local function retrieve_git_tag ()
196+ local git_tag , errorCode = os .outputof (" git describe --tag --exact-match" )
197+ if errorCode == 0 then
198+ return git_tag
199+ else
200+ return nil
201+ end
202+ end
203+
204+ if premake .action .isConfigurable () then
205+ local git_tag = retrieve_git_tag () or io .readfile (" git-tags.txt" )
206+
207+ if git_tag == " $Format:%(describe:tags=true)$" then
208+ git_tag = nil
209+ end
210+ if git_tag and git_tag :startswith (' v' ) then -- tags use v5.x.x-xxx format whereas premake uses 5.x.x-xxx
211+ git_tag = git_tag :sub (2 )
212+ end
213+ print (" Current git tag: " , git_tag )
214+ end
215+
195216 solution " Premake5"
196217 configurations { " Release" , " Debug" }
197218 location ( _OPTIONS [" to" ] )
278299 " binmodules/**.*"
279300 }
280301
302+ if git_tag then
303+ defines { ' PREMAKE_VERSION="' .. git_tag .. ' "' }
304+ end
305+
281306 filter { " options:lua-src=contrib" }
282307 includedirs { " contrib/lua/src" , " contrib/luashim" }
283308 links { " lua-lib" }
Original file line number Diff line number Diff line change 1818#include <stdint.h>
1919#include <stdlib.h>
2020
21- #define PREMAKE_VERSION "5.0.0-dev"
21+ #ifndef PREMAKE_VERSION
22+ # define PREMAKE_VERSION "5.0.0-dev"
23+ #endif
24+
2225#define PREMAKE_COPYRIGHT "Copyright (C) 2002-2025 Jess Perkins and the Premake Project"
2326#define PREMAKE_PROJECT_URL "https://github.com/premake/premake-core/wiki"
2427
You can’t perform that action at this time.
0 commit comments