Skip to content

Commit 5490fb1

Browse files
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.
1 parent 24098bc commit 5490fb1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

git-version.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ if(EXISTS ${GIT_VERSION_FILE})
2323
if(NOT ${match} EQUAL "")
2424
set(GIT_VERSION_UPDATE "0")
2525
endif()
26+
27+
# Let's also skip if it's the same.
28+
string(REPLACE "." "\\." GIT_VERSION_ESCAPED ${GIT_VERSION})
29+
file(STRINGS ${GIT_VERSION_FILE} match
30+
REGEX "PPSSPP_GIT_VERSION = \"${GIT_VERSION_ESCAPED}\";")
31+
if(NOT ${match} EQUAL "")
32+
set(GIT_VERSION_UPDATE "0")
33+
endif()
2634
endif()
2735

2836
set(code_string "// This is a generated file.\n\n"

0 commit comments

Comments
 (0)