[PATCH] D118360: [NFC][cmake] Respect LLVM_ENABLE_TERMINFO when building llvm-config

Andrew Anderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 27 06:15:04 PST 2022


andrew-wja created this revision.
andrew-wja added a reviewer: mgorny.
andrew-wja requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

llvm-config currently ignores LLVM_ENABLE_TERMINFO and always passes -ltinfo when linking the executable.

This currently breaks cross-compilation of LLVM for a target system without a native libtinfo available, which is not ideal.

This patch simply removes -ltinfo from the llvm-config link line if LLVM_ENABLE_TERMINFO is false.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D118360

Files:
  llvm/tools/llvm-config/CMakeLists.txt


Index: llvm/tools/llvm-config/CMakeLists.txt
===================================================================
--- llvm/tools/llvm-config/CMakeLists.txt
+++ llvm/tools/llvm-config/CMakeLists.txt
@@ -36,6 +36,11 @@
 endforeach()
 string(REPLACE ";" " " SYSTEM_LIBS "${SYSTEM_LIBS}")
 
+# Respect LLVM_ENABLE_TERMINFO
+if(NOT ${LLVM_ENABLE_TERMINFO})
+  string(REPLACE "-ltinfo" "" SYSTEM_LIBS "${SYSTEM_LIBS}")
+endif()
+
 # Fetch target specific compile options, e.g. RTTI option
 get_property(COMPILE_FLAGS TARGET llvm-config PROPERTY COMPILE_FLAGS)
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118360.403628.patch
Type: text/x-patch
Size: 555 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220127/fe3bdf72/attachment.bin>


More information about the llvm-commits mailing list