Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake: improve git check in GitUpdateSubmodules.cmake #876

Open
program-- opened this issue Aug 22, 2024 · 0 comments
Open

CMake: improve git check in GitUpdateSubmodules.cmake #876

program-- opened this issue Aug 22, 2024 · 0 comments
Labels
build Issues related to CMake and building ngen

Comments

@program--
Copy link
Contributor

Note

Low priority, tracking for #875 (comment)

find_package(Git QUIET)
if(EXISTS "${NGEN_ROOT_DIR}/.git")
set(NGEN_HAS_GIT_DIR ON)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
WORKING_DIRECTORY ${NGEN_ROOT_DIR}
OUTPUT_VARIABLE NGEN_GIT_COMMIT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
else()
set(NGEN_HAS_GIT_DIR OFF)
endif()

There might be edge cases associated with how we check that the current directory is a git repository.

Additionally, we probably should check for GIT_FOUND

@program-- program-- added the build Issues related to CMake and building ngen label Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues related to CMake and building ngen
Projects
None yet
Development

No branches or pull requests

1 participant