1076: Execute `git_revision.py` in the source directory r=Learath2 a=heinrich5991

Previously, if using an out-of-source build directory, git would report
an error and no revision string would be added to the final executable.
This commit is contained in:
bors[bot] 2018-03-12 22:32:32 +00:00
commit 42e1e3cf0c

View file

@ -527,10 +527,11 @@ if(NOT PROJECT_GIT_DIR_ERROR)
${PROJECT_GIT_DIR}/logs/HEAD ${PROJECT_GIT_DIR}/logs/HEAD
) )
endif() endif()
add_custom_command(OUTPUT src/game/generated/git_revision.cpp add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src/game/generated/git_revision.cpp
COMMAND ${PYTHON_EXECUTABLE} COMMAND ${PYTHON_EXECUTABLE}
${PROJECT_SOURCE_DIR}/scripts/git_revision.py scripts/git_revision.py
> src/game/generated/git_revision.cpp > ${PROJECT_BINARY_DIR}/src/game/generated/git_revision.cpp
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
DEPENDS DEPENDS
${GIT_REVISION_EXTRA_DEPS} ${GIT_REVISION_EXTRA_DEPS}
scripts/git_revision.py scripts/git_revision.py