diff options
| author | 2021-07-08 22:27:12 -0300 | |
|---|---|---|
| committer | 2021-07-08 22:27:14 -0300 | |
| commit | 849c6db3354ce659d3042863f649efc8dcd5cf12 (patch) | |
| tree | 6822eef1ac7e9b21bf7abce13238f07fe608fa4d | |
| parent | Merge pull request #6539 from lat9nq/default-setting (diff) | |
| download | yuzu-849c6db3354ce659d3042863f649efc8dcd5cf12.tar.gz yuzu-849c6db3354ce659d3042863f649efc8dcd5cf12.tar.xz yuzu-849c6db3354ce659d3042863f649efc8dcd5cf12.zip | |
cmake: Only copy pre-commit hook if .git directory exists
Allow the usage of git worktrees on yuzu.
| -rw-r--r-- | CMakeLists.txt | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b1734f36..716256cd5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -47,9 +47,10 @@ if (NOT IS_MULTI_CONFIG AND NOT CMAKE_BUILD_TYPE) | |||
| 47 | endif() | 47 | endif() |
| 48 | 48 | ||
| 49 | if(EXISTS ${PROJECT_SOURCE_DIR}/hooks/pre-commit AND NOT EXISTS ${PROJECT_SOURCE_DIR}/.git/hooks/pre-commit) | 49 | if(EXISTS ${PROJECT_SOURCE_DIR}/hooks/pre-commit AND NOT EXISTS ${PROJECT_SOURCE_DIR}/.git/hooks/pre-commit) |
| 50 | message(STATUS "Copying pre-commit hook") | 50 | if (EXISTS ${PROJECT_SOURCE_DIR}/.git/) |
| 51 | file(COPY hooks/pre-commit | 51 | message(STATUS "Copying pre-commit hook") |
| 52 | DESTINATION ${PROJECT_SOURCE_DIR}/.git/hooks) | 52 | file(COPY hooks/pre-commit DESTINATION ${PROJECT_SOURCE_DIR}/.git/hooks) |
| 53 | endif() | ||
| 53 | endif() | 54 | endif() |
| 54 | 55 | ||
| 55 | # Sanity check : Check that all submodules are present | 56 | # Sanity check : Check that all submodules are present |