mirror of https://github.com/thesofproject/sof.git
cmake: git hooks for non-unix os
Add support for non-unix systems that have bash shell. Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
This commit is contained in:
parent
3e423f418e
commit
df48bfce77
|
@ -5,8 +5,17 @@ if(NOT EXISTS "${SOF_ROOT_SOURCE_DIRECTORY}/.git")
|
|||
endif()
|
||||
|
||||
if(NOT CMAKE_HOST_UNIX)
|
||||
execute_process(
|
||||
COMMAND sh -c echo
|
||||
RESULT_VARIABLE sh_result
|
||||
OUTPUT_QUIET
|
||||
ERROR_QUIET
|
||||
)
|
||||
|
||||
if(NOT (sh_result STREQUAL "0"))
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(pre_commit_hook "${SOF_ROOT_SOURCE_DIRECTORY}/.git/hooks/pre-commit")
|
||||
set(post_commit_hook "${SOF_ROOT_SOURCE_DIRECTORY}/.git/hooks/post-commit")
|
||||
|
|
Loading…
Reference in New Issue