[PATCH] D91935: [MCJIT] Add cmake variables to customize ittapi git location and revision.

Alexey Bader via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 9 10:24:27 PST 2020


This revision was not accepted when it landed; it landed in state "Needs Revision".
This revision was automatically updated to reflect the committed changes.
Closed by commit rGbe9b4bbdfc22: [MCJIT] Add cmake variables to customize ittapi git location and revision. (authored by bader).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91935/new/

https://reviews.llvm.org/D91935

Files:
  llvm/lib/ExecutionEngine/IntelJITEvents/CMakeLists.txt


Index: llvm/lib/ExecutionEngine/IntelJITEvents/CMakeLists.txt
===================================================================
--- llvm/lib/ExecutionEngine/IntelJITEvents/CMakeLists.txt
+++ llvm/lib/ExecutionEngine/IntelJITEvents/CMakeLists.txt
@@ -1,25 +1,34 @@
 include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. )
 
-set(GIT_REPOSITORY https://github.com/intel/ittapi.git)
-set(GIT_TAG v3.18.8)
+if(NOT DEFINED ITTAPI_GIT_REPOSITORY)
+    set(ITTAPI_GIT_REPOSITORY https://github.com/intel/ittapi.git)
+endif()
+
+if(NOT DEFINED ITTAPI_GIT_TAG)
+    set(ITTAPI_GIT_TAG v3.18.8)
+endif()
+
+if(NOT DEFINED ITTAPI_SOURCE_DIR)
+    set(ITTAPI_SOURCE_DIR ${PROJECT_BINARY_DIR})
+endif()
 
-if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/ittapi)
-    execute_process(COMMAND ${GIT_EXECUTABLE} clone ${GIT_REPOSITORY}
-                    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+if(NOT EXISTS ${ITTAPI_SOURCE_DIR}/ittapi)
+    execute_process(COMMAND ${GIT_EXECUTABLE} clone ${ITTAPI_GIT_REPOSITORY}
+                    WORKING_DIRECTORY ${ITTAPI_SOURCE_DIR}
                     RESULT_VARIABLE GIT_CLONE_RESULT)
     if(NOT GIT_CLONE_RESULT EQUAL "0")
-        message(FATAL_ERROR "git clone ${GIT_REPOSITORY} failed with ${GIT_CLONE_RESULT}, please clone ${GIT_REPOSITORY}")
+        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 ${GIT_TAG}
-                WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ittapi
+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 ${GIT_TAG} failed with ${GIT_CHECKOUT_RESULT}, please checkout ${GIT_TAG} at ${CMAKE_CURRENT_SOURCE_DIR}/ittapi")
+    message(FATAL_ERROR "git checkout ${ITTAPI_GIT_TAG} failed with ${GIT_CHECKOUT_RESULT}, please checkout ${ITTAPI_GIT_TAG} at ${ITTAPI_SOURCE_DIR}/ittapi")
 endif()
 
-include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/ittapi/include/ )
+include_directories( ${ITTAPI_SOURCE_DIR}/ittapi/include/ )
 
 if( HAVE_LIBDL )
     set(LLVM_INTEL_JIT_LIBS ${CMAKE_DL_LIBS})
@@ -31,7 +40,7 @@
 add_llvm_component_library(LLVMIntelJITEvents
   IntelJITEventListener.cpp
   jitprofiling.c
-  ittapi/src/ittnotify/ittnotify_static.c
+  ${ITTAPI_SOURCE_DIR}/ittapi/src/ittnotify/ittnotify_static.c
 
   LINK_LIBS ${LLVM_INTEL_JIT_LIBS}
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91935.310576.patch
Type: text/x-patch
Size: 2582 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201209/3060f9bd/attachment.bin>


More information about the llvm-commits mailing list