Skip to content

Commit 2125e3c

Browse files
committed
cmake: enforce USE_SSH validity
Validate the USE_SSH option fits into our valid options; don't assume a default.
1 parent 0c675b8 commit 2125e3c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ option(USE_THREADS "Use threads for parallel processing when possibl
3030
option(USE_NSEC "Support nanosecond precision file mtimes and ctimes" ON)
3131

3232
# Backend selection
33-
option(USE_SSH "Enable SSH support. Can be set to a specific backend" OFF)
33+
set(USE_SSH "" CACHE STRING "Enables SSH support. One of libssh2, exec, or OFF. (Defaults to OFF.)")
3434
option(USE_HTTPS "Enable HTTPS support. Can be set to a specific backend" ON)
3535
option(USE_SHA1 "Enable SHA1. Can be set to CollisionDetection(ON)/HTTPS" ON)
3636
option(USE_SHA256 "Enable SHA256. Can be set to HTTPS/Builtin" ON)

cmake/SelectSSH.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ elseif(USE_SSH STREQUAL ON OR USE_SSH STREQUAL "libssh2")
3939
set(GIT_SSH 1)
4040
set(GIT_SSH_LIBSSH2 1)
4141
add_feature_info(SSH ON "using libssh2")
42-
else()
42+
elseif(USE_SSH STREQUAL OFF OR USE_SSH STREQUAL "")
4343
add_feature_info(SSH OFF "SSH transport support")
44+
else()
45+
message(FATAL_ERROR "unknown SSH option: ${USE_HTTP_PARSER}")
4446
endif()

0 commit comments

Comments
 (0)