Skip to content

Commit cd0d6be

Browse files
committed
[ittapi] Fix ITTAPI download/build
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.
1 parent 147a616 commit cd0d6be

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

llvm/lib/ExecutionEngine/IntelJITEvents/CMakeLists.txt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@ if(NOT DEFINED ITTAPI_SOURCE_DIR)
1212
set(ITTAPI_SOURCE_DIR ${PROJECT_BINARY_DIR})
1313
endif()
1414

15-
if(NOT EXISTS ${ITTAPI_SOURCE_DIR}/ittapi)
16-
execute_process(COMMAND ${GIT_EXECUTABLE} clone ${ITTAPI_GIT_REPOSITORY}
17-
WORKING_DIRECTORY ${ITTAPI_SOURCE_DIR}
15+
if(NOT EXISTS ${ITTAPI_SOURCE_DIR})
16+
execute_process(COMMAND ${GIT_EXECUTABLE} clone ${ITTAPI_GIT_REPOSITORY} ${ITTAPI_SOURCE_DIR}
17+
WORKING_DIRECTORY ${ITTAPI_SOURCE_DIR}/..
1818
RESULT_VARIABLE GIT_CLONE_RESULT)
1919
if(NOT GIT_CLONE_RESULT EQUAL "0")
2020
message(FATAL_ERROR "git clone ${ITTAPI_GIT_REPOSITORY} failed with ${GIT_CLONE_RESULT}, please clone ${ITTAPI_GIT_REPOSITORY}")
2121
endif()
22-
endif()
2322

24-
execute_process(COMMAND ${GIT_EXECUTABLE} checkout ${ITTAPI_GIT_TAG}
25-
WORKING_DIRECTORY ${ITTAPI_SOURCE_DIR}/ittapi
26-
RESULT_VARIABLE GIT_CHECKOUT_RESULT)
27-
if(NOT GIT_CHECKOUT_RESULT EQUAL "0")
28-
message(FATAL_ERROR "git checkout ${ITTAPI_GIT_TAG} failed with ${GIT_CHECKOUT_RESULT}, please checkout ${ITTAPI_GIT_TAG} at ${ITTAPI_SOURCE_DIR}/ittapi")
23+
execute_process(COMMAND ${GIT_EXECUTABLE} checkout ${ITTAPI_GIT_TAG}
24+
WORKING_DIRECTORY ${ITTAPI_SOURCE_DIR}
25+
RESULT_VARIABLE GIT_CHECKOUT_RESULT)
26+
if(NOT GIT_CHECKOUT_RESULT EQUAL "0")
27+
message(FATAL_ERROR "git checkout ${ITTAPI_GIT_TAG} failed with ${GIT_CHECKOUT_RESULT}, please checkout ${ITTAPI_GIT_TAG} at ${ITTAPI_SOURCE_DIR}")
28+
endif()
2929
endif()
3030

31-
include_directories( ${ITTAPI_SOURCE_DIR}/ittapi/include/ )
31+
include_directories( ${ITTAPI_SOURCE_DIR}/include/ )
3232

3333
if( HAVE_LIBDL )
3434
set(LLVM_INTEL_JIT_LIBS ${CMAKE_DL_LIBS})
@@ -40,7 +40,7 @@ set(LLVM_INTEL_JIT_LIBS ${LLVM_PTHREAD_LIB} ${LLVM_INTEL_JIT_LIBS})
4040
add_llvm_component_library(LLVMIntelJITEvents
4141
IntelJITEventListener.cpp
4242
jitprofiling.c
43-
${ITTAPI_SOURCE_DIR}/ittapi/src/ittnotify/ittnotify_static.c
43+
${ITTAPI_SOURCE_DIR}/src/ittnotify/ittnotify_static.c
4444

4545
LINK_LIBS ${LLVM_INTEL_JIT_LIBS}
4646

0 commit comments

Comments
 (0)