]> granicus.if.org Git - curl/commitdiff
cmake: don't run SORT on empty list
authorSimon Warta <simon@kullo.net>
Sat, 6 Apr 2019 13:05:50 +0000 (15:05 +0200)
committerMarcel Raad <Marcel.Raad@teamviewer.com>
Sat, 6 Apr 2019 15:53:03 +0000 (17:53 +0200)
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

index edb1cec2122ba77cd049359037d893c1653e17dd..6f513c2bcfa5c6eda3b710b8b0cc6bf3eed4a5b9 100644 (file)
@@ -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}")