Skip to content

Commit

Permalink
[ittapi] Fix ITTAPI download/build
Browse files Browse the repository at this point in the history
Use `${ITTAPI_SOURCE_DIR}` rather than `${ITTAPI_SOURCE_DIR}/ittapi` for
the ITTAPI location.

Check out the `${ITTAPI_GIT_TAG}` only if ITTAPI is cloned because when
building from a tarball (as opposed to an online build),
`${ITTAPI_SOURCE_DIR}` is not a repository so we shouldn't try to check
out a branch.
  • Loading branch information
kpamnany committed Jun 21, 2023
1 parent 147a616 commit cd0d6be
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions llvm/lib/ExecutionEngine/IntelJITEvents/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ if(NOT DEFINED ITTAPI_SOURCE_DIR)
set(ITTAPI_SOURCE_DIR ${PROJECT_BINARY_DIR})
endif()

if(NOT EXISTS ${ITTAPI_SOURCE_DIR}/ittapi)
execute_process(COMMAND ${GIT_EXECUTABLE} clone ${ITTAPI_GIT_REPOSITORY}
WORKING_DIRECTORY ${ITTAPI_SOURCE_DIR}
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 GIT_CLONE_RESULT EQUAL "0")
message(FATAL_ERROR "git clone ${ITTAPI_GIT_REPOSITORY} failed with ${GIT_CLONE_RESULT}, please clone ${ITTAPI_GIT_REPOSITORY}")
endif()
endif()

execute_process(COMMAND ${GIT_EXECUTABLE} checkout ${ITTAPI_GIT_TAG}
WORKING_DIRECTORY ${ITTAPI_SOURCE_DIR}/ittapi
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}/ittapi")
execute_process(COMMAND ${GIT_EXECUTABLE} checkout ${ITTAPI_GIT_TAG}
WORKING_DIRECTORY ${ITTAPI_SOURCE_DIR}
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}")
endif()
endif()

include_directories( ${ITTAPI_SOURCE_DIR}/ittapi/include/ )
include_directories( ${ITTAPI_SOURCE_DIR}/include/ )

if( HAVE_LIBDL )
set(LLVM_INTEL_JIT_LIBS ${CMAKE_DL_LIBS})
Expand All @@ -40,7 +40,7 @@ set(LLVM_INTEL_JIT_LIBS ${LLVM_PTHREAD_LIB} ${LLVM_INTEL_JIT_LIBS})
add_llvm_component_library(LLVMIntelJITEvents
IntelJITEventListener.cpp
jitprofiling.c
${ITTAPI_SOURCE_DIR}/ittapi/src/ittnotify/ittnotify_static.c
${ITTAPI_SOURCE_DIR}/src/ittnotify/ittnotify_static.c

LINK_LIBS ${LLVM_INTEL_JIT_LIBS}

Expand Down

0 comments on commit cd0d6be

Please sign in to comment.