diff options
author | 2016-04-16 10:19:59 +0200 | |
---|---|---|
committer | 2016-04-16 10:19:59 +0200 | |
commit | 6bb33aa52c4e02989519f9dc04d11a94df76fd3e (patch) | |
tree | 31cbf91aa6e8d47b277ccd7478cd84b939520d7a /scripts/genie.lua | |
parent | 942472ea224e9cd0c4dff6a3abe0c4c331fc314b (diff) |
Add short git version if building non-release build, also if git command is not available or if .git is not there (so building out of other sources) (nw)
Diffstat (limited to 'scripts/genie.lua')
-rw-r--r-- | scripts/genie.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/genie.lua b/scripts/genie.lua index 90df0a55d76..ca37aa1b0f5 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -349,6 +349,15 @@ newoption { } newoption { + trigger = "IGNORE_GIT", + description = "Ignore usage of git command in build process", + allowed = { + { "0", "Do not ignore" }, + { "1", "Ingore" }, + }, +} + +newoption { trigger = "SOURCES", description = "List of sources to compile.", } @@ -520,6 +529,18 @@ if (_OPTIONS["SOURCES"] == nil) then dofile (path.join("target", _OPTIONS["target"],_OPTIONS["subtarget"] .. ".lua")) end + +if _OPTIONS["IGNORE_GIT"]~="1" then + GIT_VERSION = backtick( "git rev-parse --short HEAD" ) + GIT_VERSION_RELEASE = backtick( "git rev-list --tags --max-count=1" ) + GIT_VERSION_LASTONE = backtick( "git rev-list --max-count=1 HEAD" ) + if (GIT_VERSION_RELEASE ~= GIT_VERSION_LASTONE) then + defines { + "GIT_VERSION=" .. GIT_VERSION, + } + end +end + configuration { "gmake" } flags { "SingleOutputDir", |