summaryrefslogtreecommitdiffstatshomepage
path: root/scripts/genie.lua
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2016-04-16 17:17:30 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2016-04-16 17:18:17 +0200
commit3e8559ad7ba7e9e7b57fac7ea2123803659fcb2c (patch)
tree656a0ad2fa4f9832befe6edc1807b9a2d2bb66e6 /scripts/genie.lua
parent37718e8602904d51f9132be80e2977f27cd956f5 (diff)
Always rebuild version.cpp when there is git version change (nw)
Diffstat (limited to 'scripts/genie.lua')
-rw-r--r--scripts/genie.lua24
1 files changed, 7 insertions, 17 deletions
diff --git a/scripts/genie.lua b/scripts/genie.lua
index ca37aa1b0f5..8b7f32703c3 100644
--- a/scripts/genie.lua
+++ b/scripts/genie.lua
@@ -363,15 +363,6 @@ newoption {
}
newoption {
- trigger = "FORCE_VERSION_COMPILE",
- description = "Force compiling of version.c file.",
- allowed = {
- { "0", "Disabled" },
- { "1", "Enabled" },
- }
-}
-
-newoption {
trigger = "PLATFORM",
description = "Target machine platform (x86,arm,...)",
}
@@ -530,14 +521,13 @@ if (_OPTIONS["SOURCES"] == nil) then
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,
- }
+if _OPTIONS["IGNORE_GIT"]~="1" then
+ GIT_VERSION = backtick( "git describe" )
+ local p = string.find(GIT_VERSION, '-', 1)
+ if (p~=nil) then
+ defines {
+ "GIT_VERSION=" .. string.sub(GIT_VERSION,p+1)
+ }
end
end