Build: Avoid git-version regen if matching.

This should prevent needless rebuilds, i.e. if modifying a file only for
headless or unittest this will skip linking Core and SDL.
This commit is contained in:
Unknown W. Brackets 2022-12-24 17:41:28 +00:00
parent 24098bc233
commit 5490fb1d7c

View File

@ -23,6 +23,14 @@ if(EXISTS ${GIT_VERSION_FILE})
if(NOT ${match} EQUAL "")
set(GIT_VERSION_UPDATE "0")
endif()
# Let's also skip if it's the same.
string(REPLACE "." "\\." GIT_VERSION_ESCAPED ${GIT_VERSION})
file(STRINGS ${GIT_VERSION_FILE} match
REGEX "PPSSPP_GIT_VERSION = \"${GIT_VERSION_ESCAPED}\";")
if(NOT ${match} EQUAL "")
set(GIT_VERSION_UPDATE "0")
endif()
endif()
set(code_string "// This is a generated file.\n\n"