1 include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. )
3 if(NOT DEFINED ITTAPI_GIT_REPOSITORY)
4 set(ITTAPI_GIT_REPOSITORY https://github.com/intel/ittapi.git)
7 if(NOT DEFINED ITTAPI_GIT_TAG)
8 set(ITTAPI_GIT_TAG v3.18.12)
11 if(NOT DEFINED ITTAPI_SOURCE_DIR)
12 set(ITTAPI_SOURCE_DIR ${PROJECT_BINARY_DIR})
15 if(NOT EXISTS ${ITTAPI_SOURCE_DIR}/ittapi)
16 execute_process(COMMAND ${GIT_EXECUTABLE} clone ${ITTAPI_GIT_REPOSITORY}
17 WORKING_DIRECTORY ${ITTAPI_SOURCE_DIR}
18 RESULT_VARIABLE GIT_CLONE_RESULT)
19 if(NOT GIT_CLONE_RESULT EQUAL "0")
20 message(FATAL_ERROR "git clone ${ITTAPI_GIT_REPOSITORY} failed with ${GIT_CLONE_RESULT}, please clone ${ITTAPI_GIT_REPOSITORY}")
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")
31 include_directories( ${ITTAPI_SOURCE_DIR}/ittapi/include/ )
34 set(LLVM_INTEL_JIT_LIBS ${CMAKE_DL_LIBS})
37 set(LLVM_INTEL_JIT_LIBS ${LLVM_PTHREAD_LIB} ${LLVM_INTEL_JIT_LIBS})
40 add_llvm_component_library(LLVMIntelJITEvents
41 IntelJITEventListener.cpp
43 ${ITTAPI_SOURCE_DIR}/ittapi/src/ittnotify/ittnotify_static.c
45 LINK_LIBS ${LLVM_INTEL_JIT_LIBS}
56 add_dependencies(LLVMIntelJITEvents LLVMCodeGen)