From 808b08c9880e62e1fd4728dad1799d526e29f519 Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Wed, 10 Jul 2024 09:20:04 +0900 Subject: [PATCH] luajit-cmake: Add git repository existence check Thanks @xl-sec!!! Signed-off-by: Hiroshi Hatake Co-authored-by: XL-SEC --- lib/luajit-cmake/LuaJIT.cmake | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/luajit-cmake/LuaJIT.cmake b/lib/luajit-cmake/LuaJIT.cmake index 4ad1ef565a4..c0dee5830c5 100644 --- a/lib/luajit-cmake/LuaJIT.cmake +++ b/lib/luajit-cmake/LuaJIT.cmake @@ -426,10 +426,17 @@ execute_process( OUTPUT_STRIP_TRAILING_WHITESPACE ) -if (GIT_EXISTENCE EQUAL 0) +execute_process( + COMMAND git rev-parse --is-inside-work-tree + RESULT_VARIABLE GIT_IN_REPOSITORY + OUTPUT_VARIABLE GIT_IS_IN_REPOSITORY + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +if ((GIT_EXISTENCE EQUAL 0) AND (GIT_IN_REPOSITORY EQUAL 0)) message(STATUS "Using Git: ${GIT_VERSION}") add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/luajit_relver.txt - COMMAND git show -s --format=${GIT_FORMAT} > ${CMAKE_CURRENT_BINARY_DIR}/luajit_relver.txt + COMMAND git -c log.showSignature=false show -s --format=${GIT_FORMAT} > ${CMAKE_CURRENT_BINARY_DIR}/luajit_relver.txt WORKING_DIRECTORY ${LUAJIT_DIR} ) else()