From c3cf13fc64cfbd2473e1f7764c96c2791fc1cd6f Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 20 Sep 2024 22:08:03 +0200 Subject: [PATCH] Allow passing custom git revision to CMake. --- profiler/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/profiler/CMakeLists.txt b/profiler/CMakeLists.txt index 97dadaba..f6afbe0d 100644 --- a/profiler/CMakeLists.txt +++ b/profiler/CMakeLists.txt @@ -181,8 +181,12 @@ endif() target_link_libraries(${PROJECT_NAME} PRIVATE TracyServer TracyImGui) +if(NOT DEFINED GIT_REV) + set(GIT_REV "HEAD") +endif() + add_custom_target(git-ref - COMMAND python3 ${CMAKE_CURRENT_LIST_DIR}/../extra/git-ref.py + COMMAND python3 ${CMAKE_CURRENT_LIST_DIR}/../extra/git-ref.py ${GIT_REV} BYPRODUCTS GitRef.hpp ) add_dependencies(${PROJECT_NAME} git-ref)