mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-30 12:25:49 +00:00
The relinker binary carried no build identity: a release build and a checkout of main were indistinguishable, so a report could not name the build it came from. --version prints the revision git describe reports, falling back to "unknown" when the tree has no git metadata, and needs no input or output paths. The usage line and USAGE.md list the option.
12 lines
545 B
CMake
12 lines
545 B
CMake
set(revision unknown)
|
|
if(GIT)
|
|
execute_process(COMMAND "${GIT}" -C "${SOURCE}" describe --tags --always --dirty
|
|
OUTPUT_VARIABLE described RESULT_VARIABLE failed OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
|
|
if(failed EQUAL 0 AND NOT described STREQUAL "")
|
|
set(revision ${described})
|
|
endif()
|
|
endif()
|
|
file(WRITE "${OUTPUT}.new" "#pragma once\n#define ANYPS5_RELINKER_REVISION \"${revision}\"\n")
|
|
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${OUTPUT}.new" "${OUTPUT}")
|
|
file(REMOVE "${OUTPUT}.new")
|