diff --git a/CMakeLists.txt b/CMakeLists.txt index ec7bd6c51453..c5dfef44fee8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -670,7 +670,18 @@ if(GTEST_FOUND) if(DEFINED LLVM_SO OR HIDE_PRIVATE_SYMBOLS) target_link_libraries(cpptest PRIVATE ${LLVM_LIBS}) endif() + + # Ensure we link terminfo when required by LLVM / libedit at link time. + find_package(Curses) + if(CURSES_FOUND) + message(STATUS "Found Curses/terminfo library: ${CURSES_LIBRARIES}") + target_link_libraries(cpptest PRIVATE ${CURSES_LIBRARIES}) + if(TARGET tvm_allvisible) + target_link_libraries(tvm_allvisible PRIVATE ${CURSES_LIBRARIES}) + endif() + endif() endif() + set_target_properties(cpptest PROPERTIES EXCLUDE_FROM_ALL 1) set_target_properties(cpptest PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD 1) target_compile_definitions(cpptest PRIVATE "NDEBUG")