!452 use third_party/isl-0.22.tar.gz directly instead of download it online

Merge pull request !452 from looop5/code_docs_isl
This commit is contained in:
i-robot
2021-11-16 06:48:13 +00:00
committed by Gitee
3 changed files with 28 additions and 11 deletions

View File

@@ -3,19 +3,10 @@ set(isl_CONFIG_FILE_DIR "-DISL_WRAP_DIR=${AKG_SOURCE_DIR}/third_party/isl_wrap")
set(isl_DEPEND_INCLUDE_DIR "-DGMP_INCLUDE_DIR=${GMP_INCLUDE_DIR}")
set(isl_DEPEND_LIB_DIR "-DGMP_LIBRARY=${GMP_LIBRARY}")
if(ENABLE_GITEE)
set(ISL_URL "https://gitee.com/mirrors/isl/repository/archive/isl-0.22?format=tar.gz")
set(ISL_MD5 "2098cec031b46c5837404a0de0e0b8ba")
else()
set(ISL_URL "http://isl.gforge.inria.fr/isl-0.22.tar.gz")
set(ISL_MD5 "671d0a5e10467a5c6db0893255278845")
endif()
akg_add_pkg(isl
VER 0.22
DIR ${AKG_SOURCE_DIR}/third_party/isl-0.22.tar.gz
LIBS isl_fixed
URL ${ISL_URL}
MD5 ${ISL_MD5}
CUSTOM_CMAKE ${AKG_SOURCE_DIR}/third_party/isl_wrap
PATCHES ${AKG_SOURCE_DIR}/third_party/patch/isl/isl.patch ${AKG_SOURCE_DIR}/third_party/patch/isl/isl-influence.patch
CMAKE_OPTION " ")

View File

@@ -274,7 +274,33 @@ function(akg_add_pkg pkg_name )
file(COPY ${${pkg_name}_INSTALL_SUBMODULE} DESTINATION ${${pkg_name}_SOURCE_DIR}/3rdparty/${_SUBMODENAME})
endforeach (_SUBMODULE_FILE)
else()
set(${pkg_name}_SOURCE_DIR ${PKG_DIR})
# Check if pkg is valid
if(NOT EXISTS ${PKG_DIR})
message(FATAL_ERROR "${PKG_DIR} not exits")
endif()
# If pkg is a directory, then use this directory directly
if(IS_DIRECTORY ${PKG_DIR})
set(${pkg_name}_SOURCE_DIR ${PKG_DIR})
else()
# Else, if pkg is a compressed file, decompress it first, then use the decompressed directory
set(DECOMPRESS_DIR ${CMAKE_CURRENT_BINARY_DIR}/third_party/${pkg_name})
if(EXISTS ${DECOMPRESS_DIR})
file(REMOVE_RECURSE ${DECOMPRESS_DIR})
endif()
file(MAKE_DIRECTORY ${DECOMPRESS_DIR})
message(STATUS "Decompressing ${PKG_DIR}")
if(${PKG_DIR} MATCHES ".tar.gz$")
execute_process(COMMAND tar -zxf ${PKG_DIR} -C ${DECOMPRESS_DIR}
RESULT_VARIABLE DECOMPRESS_RESULT)
if(NOT DECOMPRESS_RESULT EQUAL 0)
message(FATAL_ERROR "Decompress failed: ${PKG_DIR}")
endif()
else()
message(FATAL_ERROR "pkg can only be a directory or a .tar.gz file now, but got: ${PKG_DIR}")
endif()
FILE(GLOB ALL_FILES ${DECOMPRESS_DIR}/*)
list(GET ALL_FILES 0 ${pkg_name}_SOURCE_DIR)
endif()
endif()
message("${pkg_name}_SOURCE_DIR : ${${pkg_name}_SOURCE_DIR}")

BIN
third_party/isl-0.22.tar.gz vendored Normal file

Binary file not shown.