未验证 提交 7341e6fc 编写于 作者: W Wang Xin 提交者: GitHub

[cmake] add third party jitify cache (#55501)

* [cmake] add third party jitify cache

* fix bug

* fixed

* fix bug
上级 c63aba9e
...@@ -5,22 +5,41 @@ endif() ...@@ -5,22 +5,41 @@ endif()
include(ExternalProject) include(ExternalProject)
set(JITIFY_SOURCE_PATH ${THIRD_PARTY_PATH}/install/jitify) # clone jitify to Paddle/third_party
set(JITIFY_SOURCE_DIR ${PADDLE_SOURCE_DIR}/third_party/jitify)
set(JITIFY_URL https://github.com/NVIDIA/jitify.git)
set(JITIFY_TAG 57de649139c866eb83acacfe50c92ad7c6278776)
if(NOT EXISTS ${JITIFY_SOURCE_DIR})
execute_process(COMMAND ${GIT_EXECUTABLE} clone ${JITIFY_URL}
${JITIFY_SOURCE_DIR})
execute_process(COMMAND ${GIT_EXECUTABLE} -C ${JITIFY_SOURCE_DIR} checkout -q
${JITIFY_TAG})
else()
# check git tag
execute_process(
COMMAND ${GIT_EXECUTABLE} -C ${JITIFY_SOURCE_DIR} describe --tags
OUTPUT_VARIABLE CURRENT_TAG
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT ${CURRENT_TAG} STREQUAL ${JITIFY_TAG})
message(STATUS "Checkout JITIFY to ${JITIFY_TAG}")
execute_process(COMMAND ${GIT_EXECUTABLE} -C ${JITIFY_SOURCE_DIR} checkout
-q ${JITIFY_TAG})
endif()
endif()
ExternalProject_Add( ExternalProject_Add(
external_jitify external_jitify
${EXTERNAL_PROJECT_LOG_ARGS} ${EXTERNAL_PROJECT_LOG_ARGS}
GIT_REPOSITORY "https://github.com/NVIDIA/jitify.git" SOURCE_DIR ${JITIFY_SOURCE_DIR}
GIT_TAG 57de649139c866eb83acacfe50c92ad7c6278776
PREFIX ${THIRD_PARTY_PATH}/jitify PREFIX ${THIRD_PARTY_PATH}/jitify
SOURCE_DIR ${JITIFY_SOURCE_PATH}
CONFIGURE_COMMAND "" CONFIGURE_COMMAND ""
PATCH_COMMAND "" PATCH_COMMAND ""
BUILD_COMMAND "" BUILD_COMMAND ""
UPDATE_COMMAND "" UPDATE_COMMAND ""
INSTALL_COMMAND "") INSTALL_COMMAND "")
include_directories(${JITIFY_SOURCE_PATH}) include_directories(${JITIFY_SOURCE_DIR})
add_library(extern_jitify INTERFACE) add_library(extern_jitify INTERFACE)
add_dependencies(extern_jitify external_jitify) add_dependencies(extern_jitify external_jitify)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册