Skip to content

Commit ff82315

Browse files
committed
[lldb/CMake] Simplify linking against curses
Centralize the logic to determine what libraries to link against for curses in the CMake file where it is actually being used. Use target_include_directories instead of include_directories.
1 parent db4c7ad commit ff82315

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

lldb/cmake/modules/LLDBConfig.cmake

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,6 @@ if (APPLE)
445445
find_library(SECURITY_LIBRARY Security)
446446
set(LLDB_ENABLE_LIBXML2 ON)
447447
list(APPEND system_libs xml2
448-
${CURSES_LIBRARIES}
449448
${FOUNDATION_LIBRARY}
450449
${CORE_FOUNDATION_LIBRARY}
451450
${CORE_SERVICES_LIBRARY}
@@ -488,17 +487,10 @@ endif()
488487

489488
if (NOT LLDB_DISABLE_CURSES)
490489
find_package(Curses REQUIRED)
491-
492490
find_library(CURSES_PANEL_LIBRARY NAMES panel DOC "The curses panel library")
493491
if (NOT CURSES_PANEL_LIBRARY)
494492
message(FATAL_ERROR "A required curses' panel library not found.")
495493
endif ()
496-
497-
# Add panels to the library path
498-
set (CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_PANEL_LIBRARY})
499-
500-
list(APPEND system_libs ${CURSES_LIBRARIES})
501-
include_directories(${CURSES_INCLUDE_DIR})
502494
endif ()
503495

504496
if ((CMAKE_SYSTEM_NAME MATCHES "Android") AND LLVM_BUILD_STATIC AND

lldb/source/Core/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ set(LLDB_CURSES_LIBS)
1010
set(LLDB_LIBEDIT_LIBS)
1111

1212
if (NOT LLDB_DISABLE_CURSES)
13-
list(APPEND LLDB_CURSES_LIBS ${CURSES_LIBRARIES})
13+
list(APPEND LLDB_CURSES_LIBS ${CURSES_LIBRARIES} ${CURSES_PANEL_LIBRARY})
1414
if(LLVM_ENABLE_TERMINFO AND HAVE_TERMINFO)
1515
list(APPEND LLDB_CURSES_LIBS ${TERMINFO_LIBS})
1616
endif()
@@ -101,3 +101,7 @@ set_target_properties(lldbCore PROPERTIES LINK_INTERFACE_MULTIPLICITY 4)
101101
if (NOT LLDB_DISABLE_LIBEDIT)
102102
target_include_directories(lldbCore PRIVATE ${libedit_INCLUDE_DIRS})
103103
endif()
104+
105+
if (NOT LLDB_DISABLE_CURSES)
106+
target_include_directories(lldbCore PRIVATE ${CURSES_INCLUDE_DIR})
107+
endif()

0 commit comments

Comments
 (0)