1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 04:23:51 +00:00

Let CMake discover python3 and make it required since it is effectively needed to build

This gives a better error message and helps finding the correct python executable since python3 may actually be only named python on windows for example.
This commit is contained in:
Clément Grégoire 2025-03-08 16:37:09 +01:00
parent 2183962ef7
commit 7455e5890e

View File

@ -189,8 +189,9 @@ if(NOT DEFINED GIT_REV)
set(GIT_REV "HEAD") set(GIT_REV "HEAD")
endif() endif()
find_package(Python3 COMPONENTS Interpreter REQUIRED)
add_custom_target(git-ref add_custom_target(git-ref
COMMAND python3 ${CMAKE_CURRENT_LIST_DIR}/../extra/git-ref.py ${GIT_REV} COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/../extra/git-ref.py ${GIT_REV}
BYPRODUCTS GitRef.hpp BYPRODUCTS GitRef.hpp
) )
add_dependencies(${PROJECT_NAME} git-ref) add_dependencies(${PROJECT_NAME} git-ref)