gemini-code-assist[bot] commented on code in PR #18700:
URL: https://github.com/apache/tvm/pull/18700#discussion_r2762058595


##########
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}")

Review Comment:
   You're right, `tqchen` raises a good point about dependency bloat. While 
`find_package(Curses)` often works because `libtinfo` is frequently bundled 
with `ncurses`, explicitly searching for `libtinfo` is more precise if that's 
the only required dependency. This helps avoid pulling in unnecessary parts of 
the `Curses` library.
   
   My initial suggestion aimed for a common, robust way to find 
terminal-related libraries, but `find_library(TINFO_LIB tinfo)` directly 
addresses the specific missing dependency (`libtinfo`) as indicated by your 
problem description. This is a `medium` severity suggestion to improve 
precision and minimize dependencies.
   
   Regarding `tqchen`'s second point, ideally, `llvm-config` should provide all 
necessary linker flags for its dependencies. If it doesn't include `-ltinfo` on 
certain systems, then explicitly finding and linking it as a workaround is a 
pragmatic approach for now. The long-term solution would involve ensuring 
`FindLLVM.cmake` or the `llvm-config` output itself correctly reports this 
dependency.
   
   ```suggestion
       find_library(TINFO_LIB tinfo)
       if(TINFO_LIB)
          message(STATUS "Found terminfo library: ${TINFO_LIB}")
          target_link_libraries(cpptest PRIVATE ${TINFO_LIB})
          if(TARGET tvm_allvisible)
             target_link_libraries(tvm_allvisible PRIVATE ${TINFO_LIB})
          endif()
       endif()
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to