Skip to content

Commit e79c080

Browse files
authored
[cmake] Allow multiple LibEdit_LIBRARIES (#93896)
If built statically, `libedit` may have a private static library dependency on a provider of the `terminfo` API (e.g., `ncurses`). This means that multiple libraries would need to be provided as the value for `LibEdit_LIBRARIES`, but the current implementation of `FindLibEdit` precludes this. This PR allows a list to be passed to `LibEdit_LIBRARIES`.
1 parent e19565c commit e79c080

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/cmake/modules/FindLibEdit.cmake

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ find_package_handle_standard_args(LibEdit
5959
mark_as_advanced(LibEdit_INCLUDE_DIRS LibEdit_LIBRARIES)
6060

6161
if (LibEdit_FOUND AND NOT TARGET LibEdit::LibEdit)
62-
add_library(LibEdit::LibEdit UNKNOWN IMPORTED)
63-
set_target_properties(LibEdit::LibEdit PROPERTIES
64-
IMPORTED_LOCATION ${LibEdit_LIBRARIES}
65-
INTERFACE_INCLUDE_DIRECTORIES ${LibEdit_INCLUDE_DIRS})
62+
add_library(LibEdit::LibEdit INTERFACE IMPORTED)
63+
target_link_libraries(LibEdit::LibEdit INTERFACE ${LibEdit_LIBRARIES})
64+
target_include_directories(LibEdit::LibEdit INTERFACE ${LibEdit_INCLUDE_DIRS})
6665
endif()

0 commit comments

Comments
 (0)