diff options
author | 2016-06-10 00:36:29 +1000 | |
---|---|---|
committer | 2016-06-10 00:36:29 +1000 | |
commit | 93cd0cd40bae01b637132542a93ddbb297d2b0d6 (patch) | |
tree | d98d7b4054c8052206c0280e3c101034e587b729 /scripts/src/main.lua | |
parent | ebd8e7d74b798ee0c7dc2232d72c13b0d51e1fe4 (diff) |
Fix git version [Vas Crabb]
* git version is set by top-level make, not just when GENie runs
* can set IGNORE_GIT=1 for make to ignore git
* git ignored/unavailable uses "unknown" in version string
* mark modified trees as dirty
* note that version now comes from makefile
Diffstat (limited to 'scripts/src/main.lua')
-rw-r--r-- | scripts/src/main.lua | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/scripts/src/main.lua b/scripts/src/main.lua index d5cce436dce..42615bedebb 100644 --- a/scripts/src/main.lua +++ b/scripts/src/main.lua @@ -147,17 +147,7 @@ end end configuration { } - -if _OPTIONS["IGNORE_GIT"]~="1" then - GIT_VERSION = backtick( "git describe --dirty" ) - local p = string.find(GIT_VERSION, '-', 1) - if (p~=nil) then - defines { - "GIT_VERSION=" .. string.sub(GIT_VERSION,p+1) - } - end -end - + if _OPTIONS["targetos"]=="android" then includedirs { MAME_DIR .. "3rdparty/SDL2/include", @@ -277,7 +267,7 @@ if (STANDALONE~=true) then "-sectcreate __TEXT __info_plist " .. _MAKE.esc(GEN_DIR) .. "resource/" .. _subtarget .. "-Info.plist" } custombuildtask { - { MAME_DIR .. "src/version.cpp" , GEN_DIR .. "resource/" .. _subtarget .. "-Info.plist", { MAME_DIR .. "scripts/build/verinfo.py" }, {"@echo Emitting " .. _subtarget .. "-Info.plist" .. "...", PYTHON .. " $(1) -p -b " .. _subtarget .. " $(<) > $(@)" }}, + { GEN_DIR .. "version.cpp" , GEN_DIR .. "resource/" .. _subtarget .. "-Info.plist", { MAME_DIR .. "scripts/build/verinfo.py" }, {"@echo Emitting " .. _subtarget .. "-Info.plist" .. "...", PYTHON .. " $(1) -p -b " .. _subtarget .. " $(<) > $(@)" }}, } dependency { { "$(TARGET)" , GEN_DIR .. "resource/" .. _subtarget .. "-Info.plist", true }, @@ -312,7 +302,7 @@ if (STANDALONE~=true) then end files { mainfile, - MAME_DIR .. "src/version.cpp", + GEN_DIR .. "version.cpp", GEN_DIR .. _target .. "/" .. _subtarget .."/drivlist.cpp", } @@ -355,14 +345,14 @@ if (STANDALONE~=true) then configuration { "mingw*" } custombuildtask { - { MAME_DIR .. "src/version.cpp" , GEN_DIR .. "resource/" .. rctarget .. "vers.rc", { MAME_DIR .. "scripts/build/verinfo.py" }, {"@echo Emitting " .. rctarget .. "vers.rc" .. "...", PYTHON .. " $(1) -r -b " .. rctarget .. " $(<) > $(@)" }}, + { GEN_DIR .. "version.cpp" , GEN_DIR .. "resource/" .. rctarget .. "vers.rc", { MAME_DIR .. "scripts/build/verinfo.py" }, {"@echo Emitting " .. rctarget .. "vers.rc" .. "...", PYTHON .. " $(1) -r -b " .. rctarget .. " $(<) > $(@)" }}, } configuration { "vs*" } prebuildcommands { "mkdir " .. path.translate(GEN_DIR .. "resource/","\\") .. " 2>NUL", "@echo Emitting ".. rctarget .. "vers.rc...", - PYTHON .. " " .. path.translate(MAME_DIR .. "scripts/build/verinfo.py","\\") .. " -r -b " .. rctarget .. " " .. path.translate(MAME_DIR .. "src/version.cpp","\\") .. " > " .. path.translate(GEN_DIR .. "resource/" .. rctarget .. "vers.rc", "\\") , + PYTHON .. " " .. path.translate(MAME_DIR .. "scripts/build/verinfo.py","\\") .. " -r -b " .. rctarget .. " " .. path.translate(GEN_DIR .. "version.cpp","\\") .. " > " .. path.translate(GEN_DIR .. "resource/" .. rctarget .. "vers.rc", "\\") , } end |