From: Simon Warta Date: Sat, 6 Apr 2019 13:05:50 +0000 (+0200) Subject: cmake: don't run SORT on empty list X-Git-Tag: curl-7_65_0~197 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1a3aa5c32117e94d8838c8ec85a68e8ae83898c5;p=thirdparty%2Fcurl.git 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 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index edb1cec212..6f513c2bcf 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}")