From 1a3aa5c32117e94d8838c8ec85a68e8ae83898c5 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Sat, 6 Apr 2019 15:05:50 +0200 Subject: [PATCH] cmake: don't run SORT on empty list In case of an empty list, SORTing leads to the cmake error "list sub-command SORT requires list to be present." Closes https://github.com/curl/curl/pull/3736 --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index edb1cec21..6f513c2bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1239,7 +1239,9 @@ _add_if("SCP" USE_LIBSSH2) _add_if("SFTP" USE_LIBSSH2) _add_if("RTSP" NOT CURL_DISABLE_RTSP) _add_if("RTMP" USE_LIBRTMP) -list(SORT _items) +if(_items) + list(SORT _items) +endif() string(REPLACE ";" " " SUPPORT_PROTOCOLS "${_items}") message(STATUS "Enabled protocols: ${SUPPORT_PROTOCOLS}")