[llvm] e79c080 - [cmake] Allow multiple LibEdit_LIBRARIES (#93896)

via llvm-commits llvm-commits at lists.llvm.org
Fri May 31 11:36:37 PDT 2024


Author: Daniel Thornburgh
Date: 2024-05-31T11:36:33-07:00
New Revision: e79c0806552880aa802c83f1edf59a3ffd39bdcc

URL: https://github.com/llvm/llvm-project/commit/e79c0806552880aa802c83f1edf59a3ffd39bdcc
DIFF: https://github.com/llvm/llvm-project/commit/e79c0806552880aa802c83f1edf59a3ffd39bdcc.diff

LOG: [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`.

Added: 
    

Modified: 
    llvm/cmake/modules/FindLibEdit.cmake

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/modules/FindLibEdit.cmake b/llvm/cmake/modules/FindLibEdit.cmake
index de8f5a2e71013..b3f49e1477f0b 100644
--- a/llvm/cmake/modules/FindLibEdit.cmake
+++ b/llvm/cmake/modules/FindLibEdit.cmake
@@ -59,8 +59,7 @@ find_package_handle_standard_args(LibEdit
 mark_as_advanced(LibEdit_INCLUDE_DIRS LibEdit_LIBRARIES)
 
 if (LibEdit_FOUND AND NOT TARGET LibEdit::LibEdit)
-  add_library(LibEdit::LibEdit UNKNOWN IMPORTED)
-  set_target_properties(LibEdit::LibEdit PROPERTIES
-                        IMPORTED_LOCATION ${LibEdit_LIBRARIES}
-                        INTERFACE_INCLUDE_DIRECTORIES ${LibEdit_INCLUDE_DIRS})
+  add_library(LibEdit::LibEdit INTERFACE IMPORTED)
+  target_link_libraries(LibEdit::LibEdit INTERFACE ${LibEdit_LIBRARIES})
+  target_include_directories(LibEdit::LibEdit INTERFACE ${LibEdit_INCLUDE_DIRS})
 endif()


        


More information about the llvm-commits mailing list