[PATCH] D51799: [CMake] Avoid REVERSE on empty list
Sven van Haastregt via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 7 09:23:50 PDT 2018
svenvh created this revision.
svenvh added reviewers: beanz, whitequark.
Herald added subscribers: llvm-commits, mgorny.
If `required_libs` happens to remain empty, CMake would bail out with:
list sub-command REVERSE requires list to be present.
Fix by ensuring we do not attempt to reverse an empty list.
Repository:
rL LLVM
https://reviews.llvm.org/D51799
Files:
cmake/modules/LLVM-Config.cmake
Index: cmake/modules/LLVM-Config.cmake
===================================================================
--- cmake/modules/LLVM-Config.cmake
+++ cmake/modules/LLVM-Config.cmake
@@ -302,7 +302,9 @@
expand_topologically(${lib} "${required_libs}" "${visited_libs}")
endforeach()
- list(REVERSE required_libs)
+ if(required_libs)
+ list(REVERSE required_libs)
+ endif()
set(${out_libs} ${required_libs} PARENT_SCOPE)
endfunction()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51799.164443.patch
Type: text/x-patch
Size: 451 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180907/7041d4c1/attachment-0001.bin>
More information about the llvm-commits
mailing list