cmake: sync CURL_DISABLE_* behaviour with autotools

- disable RTSP, ALTSVC, HSTS when HTTP is disabled.
  (`./configure` warning deemed unnecessary and not replicated with
  cmake.)

- disable HSTS when there is no TLS backend.

Tested via #14744
Closes #14745
This commit is contained in:
Viktor Szakats 2024-08-30 20:42:54 +02:00
parent d4240b9bf2
commit 3fc81be44e
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201

View File

@ -330,6 +330,12 @@ mark_as_advanced(CURL_DISABLE_TFTP)
option(CURL_DISABLE_VERBOSE_STRINGS "Disable verbose strings" OFF)
mark_as_advanced(CURL_DISABLE_VERBOSE_STRINGS)
if(CURL_DISABLE_HTTP)
set(CURL_DISABLE_RTSP ON)
set(CURL_DISABLE_ALTSVC ON)
set(CURL_DISABLE_HSTS ON)
endif()
# Corresponds to HTTP_ONLY in lib/curl_setup.h
option(HTTP_ONLY "Disable all protocols except HTTP (This overrides all CURL_DISABLE_* options)" OFF)
mark_as_advanced(HTTP_ONLY)
@ -492,6 +498,8 @@ count_true(_enabled_ssl_options_count
)
if(_enabled_ssl_options_count GREATER 1)
set(CURL_WITH_MULTI_SSL ON)
elseif(_enabled_ssl_options_count EQUAL 0)
set(CURL_DISABLE_HSTS ON)
endif()
if(CURL_USE_SCHANNEL)