Skip to content

Commit

Permalink
In claude we trust
Browse files Browse the repository at this point in the history
Fix by not setting working directory as ittapi source dir might not exist. Also, quote paths in case of whitespace
  • Loading branch information
Zentrik authored Oct 11, 2024
1 parent cc00775 commit 0d6238b
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions llvm/lib/ExecutionEngine/IntelJITProfiling/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,21 @@ if(NOT DEFINED ITTAPI_SOURCE_DIR)
set(ITTAPI_SOURCE_DIR ${PROJECT_BINARY_DIR}/ittapi)
endif()

if(NOT EXISTS ${ITTAPI_SOURCE_DIR})
execute_process(COMMAND ${GIT_EXECUTABLE} clone ${ITTAPI_GIT_REPOSITORY} ${ITTAPI_SOURCE_DIR}
WORKING_DIRECTORY ${ITTAPI_SOURCE_DIR}/..
RESULT_VARIABLE GIT_CLONE_RESULT)
if(NOT EXISTS "${ITTAPI_SOURCE_DIR}")
execute_process(
COMMAND "${GIT_EXECUTABLE}" clone "${ITTAPI_GIT_REPOSITORY}" "${ITTAPI_SOURCE_DIR}"
RESULT_VARIABLE GIT_CLONE_RESULT
)
if(NOT GIT_CLONE_RESULT EQUAL "0")
message(FATAL_ERROR "git clone ${ITTAPI_GIT_REPOSITORY} failed with ${GIT_CLONE_RESULT}, please clone ${ITTAPI_GIT_REPOSITORY}")
message(FATAL_ERROR "git clone ${ITTAPI_GIT_REPOSITORY} failed with ${GIT_CLONE_RESULT}, please clone ${ITTAPI_GIT_REPOSITORY} manually")
endif()
execute_process(COMMAND ${GIT_EXECUTABLE} checkout ${ITTAPI_GIT_TAG}
WORKING_DIRECTORY ${ITTAPI_SOURCE_DIR}
RESULT_VARIABLE GIT_CHECKOUT_RESULT)

execute_process(
COMMAND "${GIT_EXECUTABLE}" -C "${ITTAPI_SOURCE_DIR}" checkout "${ITTAPI_GIT_TAG}"
RESULT_VARIABLE GIT_CHECKOUT_RESULT
)
if(NOT GIT_CHECKOUT_RESULT EQUAL "0")
message(FATAL_ERROR "git checkout ${ITTAPI_GIT_TAG} failed with ${GIT_CHECKOUT_RESULT}, please checkout ${ITTAPI_GIT_TAG} at ${ITTAPI_SOURCE_DIR}")
message(FATAL_ERROR "git checkout ${ITTAPI_GIT_TAG} failed with ${GIT_CHECKOUT_RESULT}, please checkout ${ITTAPI_GIT_TAG} at ${ITTAPI_SOURCE_DIR} manually")
endif()
endif()

Expand Down

0 comments on commit 0d6238b

Please sign in to comment.