1include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. ) 2 3if(NOT DEFINED ITTAPI_GIT_REPOSITORY) 4 set(ITTAPI_GIT_REPOSITORY https://github.com/intel/ittapi.git) 5endif() 6 7if(NOT DEFINED ITTAPI_GIT_TAG) 8 set(ITTAPI_GIT_TAG v3.18.12) 9endif() 10 11if(NOT DEFINED ITTAPI_SOURCE_DIR) 12 set(ITTAPI_SOURCE_DIR ${PROJECT_BINARY_DIR}) 13endif() 14 15if(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}") 21 endif() 22endif() 23 24execute_process(COMMAND ${GIT_EXECUTABLE} checkout ${ITTAPI_GIT_TAG} 25 WORKING_DIRECTORY ${ITTAPI_SOURCE_DIR}/ittapi 26 RESULT_VARIABLE GIT_CHECKOUT_RESULT) 27if(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") 29endif() 30 31include_directories( ${ITTAPI_SOURCE_DIR}/ittapi/include/ ) 32 33if( HAVE_LIBDL ) 34 set(LLVM_INTEL_JIT_LIBS ${CMAKE_DL_LIBS}) 35endif() 36 37set(LLVM_INTEL_JIT_LIBS ${LLVM_PTHREAD_LIB} ${LLVM_INTEL_JIT_LIBS}) 38 39 40add_llvm_component_library(LLVMIntelJITProfiling 41 jitprofiling.c 42 ${ITTAPI_SOURCE_DIR}/ittapi/src/ittnotify/ittnotify_static.c 43 44 LINK_LIBS ${LLVM_INTEL_JIT_LIBS} 45 46) 47 48