summaryrefslogtreecommitdiffstats
path: root/lldb/cmake/modules
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-12-20 20:53:33 -0800
committerJonas Devlieghere <jonas@devlieghere.com>2019-12-20 20:53:33 -0800
commitc51ad1f836bffb4e431eb9f948ee3a32902ba6d2 (patch)
tree64beeb0fbf010ae3f1d1367edd2f509c47fc4f91 /lldb/cmake/modules
parent94b1bc0fb86a081caae0a919c0ecdb732a84e8ad (diff)
downloadbcm5719-llvm-c51ad1f836bffb4e431eb9f948ee3a32902ba6d2.tar.gz
bcm5719-llvm-c51ad1f836bffb4e431eb9f948ee3a32902ba6d2.zip
[lldb/CMake] Don't use return() from macro()
> A macro is executed as if the macro body were pasted in place of the > calling statement. This has the consequence that a return() in a macro > body does not just terminate execution of the macro After converting from a function() to a macro(), the return() became invalid. This modifies the control flow to elude the return.
Diffstat (limited to 'lldb/cmake/modules')
-rw-r--r--lldb/cmake/modules/LLDBConfig.cmake11
1 files changed, 7 insertions, 4 deletions
diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake
index 3fc466b8f35..c34ef76cb65 100644
--- a/lldb/cmake/modules/LLDBConfig.cmake
+++ b/lldb/cmake/modules/LLDBConfig.cmake
@@ -29,16 +29,19 @@ macro(add_optional_dependency variable description package found)
string(TOUPPER "${${variable}}" ${variable})
if("${${variable}}" STREQUAL "AUTO")
+ set(find_package TRUE)
set(maybe_required)
elseif(${${variable}})
+ set(find_package TRUE)
set(maybe_required REQUIRED)
else()
- set(${variable} OFF PARENT_SCOPE)
- return()
+ set(${variable} FALSE PARENT_SCOPE)
endif()
- find_package(${package} ${maybe_required})
- set(${variable} "${${found}}")
+ if(${find_package})
+ find_package(${package} ${maybe_required})
+ set(${variable} "${${found}}")
+ endif()
endmacro()
add_optional_dependency(LLDB_ENABLE_LIBEDIT "Enable editline support." LibEdit libedit_FOUND)
OpenPOWER on IntegriCloud