未验证 提交 988b252a 编写于 作者: G gouzil 提交者: GitHub

[cmake] add absl third_party cache (#55549)

* add absl to third_party

* fix

* ci test

* ci test

* ci test

* rollback
上级 a9d3cef9
...@@ -326,10 +326,6 @@ set(CINN_LIB "${CINN_LIB_LOCATION}/${CINN_LIB_NAME}") ...@@ -326,10 +326,6 @@ set(CINN_LIB "${CINN_LIB_LOCATION}/${CINN_LIB_NAME}")
# Add CINN's dependencies header files # Add CINN's dependencies header files
###################################### ######################################
# Add absl
set(ABSL_INCLUDE_DIR "${CMAKE_BINARY_DIR}/dist/third_party/absl/include")
include_directories(${ABSL_INCLUDE_DIR})
# Add isl # Add isl
set(ISL_INCLUDE_DIR "${CMAKE_BINARY_DIR}/third_party/install/isl/include") set(ISL_INCLUDE_DIR "${CMAKE_BINARY_DIR}/third_party/install/isl/include")
include_directories(${ISL_INCLUDE_DIR}) include_directories(${ISL_INCLUDE_DIR})
......
include(ExternalProject) include(ExternalProject)
set(ABSL_SOURCES_DIR ${THIRD_PARTY_PATH}/absl) set(ABSL_SOURCES_DIR ${PADDLE_SOURCE_DIR}/third_party/absl)
set(ABSL_INSTALL_DIR ${THIRD_PARTY_PATH}/install/absl) set(ABSL_INSTALL_DIR ${THIRD_PARTY_PATH}/install/absl)
set(ABSL_PREFIX_DIR ${THIRD_PARTY_PATH}/absl)
set(ABSL_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) set(ABSL_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
set(ABSL_REPOSITORY "https://github.com/abseil/abseil-cpp.git") set(ABSL_REPOSITORY "https://github.com/abseil/abseil-cpp.git")
set(ABSL_TAG "20210324.2") set(ABSL_TAG "20210324.2")
if(NOT EXISTS ${ABSL_SOURCES_DIR})
message(
STATUS "Download absl source from ${ABSL_REPOSITORY} to ABSL_SOURCES_DIR")
execute_process(COMMAND ${GIT_EXECUTABLE} clone -b ${ABSL_TAG}
${ABSL_REPOSITORY} ${ABSL_SOURCES_DIR})
else()
# check git tag
execute_process(
COMMAND ${GIT_EXECUTABLE} -C ${ABSL_SOURCES_DIR} describe --tags
OUTPUT_VARIABLE CURRENT_TAG
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT ${CURRENT_TAG} STREQUAL ${ABSL_TAG})
message(STATUS "Checkout absl to ${ABSL_TAG}")
execute_process(COMMAND ${GIT_EXECUTABLE} -C ${ABSL_SOURCES_DIR} checkout
-q ${ABSL_TAG})
endif()
endif()
set(OPTIONAL_ARGS set(OPTIONAL_ARGS
"-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}" "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
"-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}" "-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}"
...@@ -22,9 +40,8 @@ ExternalProject_Add( ...@@ -22,9 +40,8 @@ ExternalProject_Add(
external_absl external_absl
${EXTERNAL_PROJECT_LOG_ARGS} ${EXTERNAL_PROJECT_LOG_ARGS}
DEPENDS gflags DEPENDS gflags
GIT_REPOSITORY ${ABSL_REPOSITORY} PREFIX ${ABSL_PREFIX_DIR}
GIT_TAG ${ABSL_TAG} SOURCE_DIR ${ABSL_SOURCES_DIR}
PREFIX ${ABSL_SOURCES_DIR}
UPDATE_COMMAND "" UPDATE_COMMAND ""
CMAKE_ARGS ${OPTIONAL_ARGS} CMAKE_ARGS ${OPTIONAL_ARGS}
-DCMAKE_INSTALL_PREFIX=${ABSL_INSTALL_DIR} -DCMAKE_INSTALL_PREFIX=${ABSL_INSTALL_DIR}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册