From 93cd0cd40bae01b637132542a93ddbb297d2b0d6 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Fri, 10 Jun 2016 00:36:29 +1000 Subject: 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 --- scripts/src/main.lua | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'scripts/src/main.lua') 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 -- cgit v1.2.3-70-g09d2