Skip to content

Commit

Permalink
Build: Avoid git-version regen if matching.
Browse files Browse the repository at this point in the history
This should prevent needless rebuilds, i.e. if modifying a file only for
headless or unittest this will skip linking Core and SDL.
  • Loading branch information
unknownbrackets committed Dec 24, 2022
1 parent 24098bc commit 5490fb1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions git-version.cmake
Expand Up @@ -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"
Expand Down

0 comments on commit 5490fb1

Please sign in to comment.