diff options
| author | Sven van Haastregt <sven.vanhaastregt@arm.com> | 2018-09-26 10:14:10 +0000 |
|---|---|---|
| committer | Sven van Haastregt <sven.vanhaastregt@arm.com> | 2018-09-26 10:14:10 +0000 |
| commit | 4e8337e001ac2e0cf96f4cacdbdf4df227d7b27e (patch) | |
| tree | ef397b59aabfc128cc8362d4304ae284499c9702 /llvm/cmake/modules | |
| parent | 9123b7ebea4be5d04eae63209f601683595bed87 (diff) | |
| download | bcm5719-llvm-4e8337e001ac2e0cf96f4cacdbdf4df227d7b27e.tar.gz bcm5719-llvm-4e8337e001ac2e0cf96f4cacdbdf4df227d7b27e.zip | |
[CMake] Avoid REVERSE on unset variable
If required_libs happens to remain unset, CMake would fail with:
list sub-command REVERSE requires list to be present.
Fix by ensuring we do not attempt to reverse an unset variable.
Reported by Tu Vuong.
Differential Revision: https://reviews.llvm.org/D51799
llvm-svn: 343088
Diffstat (limited to 'llvm/cmake/modules')
| -rw-r--r-- | llvm/cmake/modules/LLVM-Config.cmake | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/cmake/modules/LLVM-Config.cmake b/llvm/cmake/modules/LLVM-Config.cmake index 8eabddc7377..474a874a442 100644 --- a/llvm/cmake/modules/LLVM-Config.cmake +++ b/llvm/cmake/modules/LLVM-Config.cmake @@ -302,7 +302,9 @@ function(llvm_expand_dependencies out_libs) 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() |

