mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-10 15:14:44 +00:00
cmake: add support for vendored cmake
Use a "cmake-vendored" directory if it exists, to avoid accessing the network if it's available, and a target to create an appropriate tarball to create that directory.
This commit is contained in:
parent
3ae16a5b95
commit
1c978f7ec5
1 changed files with 19 additions and 9 deletions
|
@ -1,3 +1,6 @@
|
|||
if(EXISTS "${CMAKE_SOURCE_DIR}/corrosion-vendor/")
|
||||
add_subdirectory("${CMAKE_SOURCE_DIR}/corrosion-vendor/")
|
||||
else()
|
||||
include(FetchContent)
|
||||
|
||||
# Don't let Corrosion's tests interfere with ours.
|
||||
|
@ -11,6 +14,13 @@ FetchContent_Declare(
|
|||
|
||||
FetchContent_MakeAvailable(Corrosion)
|
||||
|
||||
add_custom_target(corrosion-vendor.tar.gz
|
||||
COMMAND git archive --format tar.gz --output "${CMAKE_BINARY_DIR}/corrosion-vendor.tar.gz"
|
||||
--prefix corrosion-vendor/ HEAD
|
||||
WORKING_DIRECTORY ${corrosion_SOURCE_DIR}
|
||||
)
|
||||
endif()
|
||||
|
||||
set(fish_rust_target "fish-rust")
|
||||
|
||||
set(fish_autocxx_gen_dir "${CMAKE_BINARY_DIR}/fish-autocxx-gen/")
|
||||
|
|
Loading…
Reference in a new issue