mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +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,15 +1,25 @@
|
|||
include(FetchContent)
|
||||
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.
|
||||
set(CORROSION_TESTS OFF CACHE BOOL "" FORCE)
|
||||
# Don't let Corrosion's tests interfere with ours.
|
||||
set(CORROSION_TESTS OFF CACHE BOOL "" FORCE)
|
||||
|
||||
FetchContent_Declare(
|
||||
Corrosion
|
||||
GIT_REPOSITORY https://github.com/mqudsi/corrosion
|
||||
GIT_TAG fish
|
||||
)
|
||||
FetchContent_Declare(
|
||||
Corrosion
|
||||
GIT_REPOSITORY https://github.com/mqudsi/corrosion
|
||||
GIT_TAG fish
|
||||
)
|
||||
|
||||
FetchContent_MakeAvailable(Corrosion)
|
||||
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")
|
||||
|
||||
|
|
Loading…
Reference in a new issue