mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 19:35:37 +00:00
build: don't download and extract tarball if source is already present
When building under Homebrew, we want to let Homebrew manage downloading and extracting the tarballs.
This commit is contained in:
11
third-party/cmake/DownloadAndExtractFile.cmake
vendored
11
third-party/cmake/DownloadAndExtractFile.cmake
vendored
@@ -18,6 +18,15 @@ if(NOT DEFINED TARGET)
|
|||||||
message(FATAL_ERROR "TARGET must be defined.")
|
message(FATAL_ERROR "TARGET must be defined.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(SRC_DIR ${PREFIX}/src/${TARGET})
|
||||||
|
|
||||||
|
# Check whether the source has been downloaded. If true, skip it.
|
||||||
|
# Useful for external downloads like homebrew.
|
||||||
|
if(EXISTS "${SRC_DIR}" AND IS_DIRECTORY "${SRC_DIR}")
|
||||||
|
message(STATUS "${SRC_DIR} is found, skipping download and extraction. ")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
# Taken from ExternalProject_Add. Let's hope we can drop this one day when
|
# Taken from ExternalProject_Add. Let's hope we can drop this one day when
|
||||||
# ExternalProject_Add allows you to disable SHOW_PROGRESS on the file download.
|
# ExternalProject_Add allows you to disable SHOW_PROGRESS on the file download.
|
||||||
if(TIMEOUT)
|
if(TIMEOUT)
|
||||||
@@ -65,8 +74,6 @@ endif()
|
|||||||
|
|
||||||
message(STATUS "downloading... done")
|
message(STATUS "downloading... done")
|
||||||
|
|
||||||
set(SRC_DIR ${PREFIX}/src/${TARGET})
|
|
||||||
|
|
||||||
# Slurped from a generated extract-TARGET.cmake file.
|
# Slurped from a generated extract-TARGET.cmake file.
|
||||||
message(STATUS "extracting...
|
message(STATUS "extracting...
|
||||||
src='${file}'
|
src='${file}'
|
||||||
|
|||||||
Reference in New Issue
Block a user