Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-land "[lldb/CMake] Change how we deal with optional dependencies"
Recently there has been some discussion about how we deal with optional dependencies in LLDB. The approach in LLVM is to make things work out of the box. If the dependency isn't there, we move on silently. That's not true for LLDB. Unless you explicitly disable the dependency with LLDB_ENABLE_*, you'll get a configuration-time error. The historical reason for this is that LLDB's dependencies have a much broader impact, think about Python for example which is required to run the test suite. The current approach can be frustrating from a user experience perspective. Sometimes you just want to ensure LLDB builds with a change in clang. This patch changes the optional dependencies (with the exception of Python) to a new scheme. The LLDB_ENABLE_* now takes three values: On, Off or Auto, with the latter being the default. On and Off behave the same as today, forcing the dependency to be enabled or disabled. If the dependency is set to On but is not found, it results in a configuration time warning. For Auto we detect if the dependency is there and either enable or disable it depending on whether it's found. Differential revision: https://reviews.llvm.org/D71306 PS: The reason Python isn't included yet is because it's so pervasive that I plan on doing that in a separate patch.
- Loading branch information
1 parent
bad8f39
commit 94b1bc0
Showing
4 changed files
with
57 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#.rst: | ||
# FindCursesAndPanel | ||
# ----------- | ||
# | ||
# Find the curses and panel library as a whole. | ||
|
||
if(CURSES_INCLUDE_DIRS AND CURSES_LIBRARIES AND PANEL_LIBRARIES) | ||
set(CURSESANDPANEL_FOUND TRUE) | ||
else() | ||
find_package(Curses QUIET) | ||
find_library(PANEL_LIBRARIES NAMES panel DOC "The curses panel library" QUIET) | ||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(CursesAndPanel | ||
FOUND_VAR | ||
CURSESANDPANEL_FOUND | ||
REQUIRED_VARS | ||
CURSES_INCLUDE_DIRS | ||
CURSES_LIBRARIES | ||
PANEL_LIBRARIES) | ||
if(CURSES_FOUND AND PANEL_LIBRARIES) | ||
mark_as_advanced(CURSES_INCLUDE_DIRS CURSES_LIBRARIES PANEL_LIBRARIES) | ||
endif() | ||
endif() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters