JDevlieghere created this revision.
JDevlieghere added reviewers: zturner, stella.stamenova, labath, sgraenitz.
Herald added a subscriber: mgorny.
Herald added a project: LLDB.

The utility library shouldn't depend on curses, libedit or python since it uses 
none of them. Move the first two to libCore where they are actually used.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D59970

Files:
  lldb/source/Core/CMakeLists.txt
  lldb/source/Utility/CMakeLists.txt


Index: lldb/source/Utility/CMakeLists.txt
===================================================================
--- lldb/source/Utility/CMakeLists.txt
+++ lldb/source/Utility/CMakeLists.txt
@@ -1,46 +1,15 @@
 set(LLDB_SYSTEM_LIBS)
 
-# Windows-only libraries
-if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
-  list(APPEND LLDB_SYSTEM_LIBS
-    ws2_32
-    rpcrt4
-    )
-endif ()
+list(APPEND LLDB_SYSTEM_LIBS ${system_libs})
 
-if (NOT LLDB_DISABLE_LIBEDIT)
-  list(APPEND LLDB_SYSTEM_LIBS ${libedit_LIBRARIES})
-endif()
-if (NOT LLDB_DISABLE_CURSES)
-  list(APPEND LLDB_SYSTEM_LIBS ${CURSES_LIBRARIES})
-  if(LLVM_ENABLE_TERMINFO AND HAVE_TERMINFO)
-    list(APPEND LLDB_SYSTEM_LIBS ${TERMINFO_LIBS})
-  endif()
-endif()
+if (CMAKE_SYSTEM_NAME MATCHES "Windows")
+  list(APPEND LLDB_SYSTEM_LIBS ws2_32 rpcrt4)
+endif ()
 
 if (NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB )
     list(APPEND LLDB_SYSTEM_LIBS atomic)
 endif()
 
-if(Backtrace_FOUND)
-  list(APPEND LLDB_SYSTEM_LIBS ${Backtrace_LIBRARY})
-endif()
-
-if (NOT LLDB_DISABLE_PYTHON AND NOT LLVM_BUILD_STATIC)
-  list(APPEND LLDB_SYSTEM_LIBS ${PYTHON_LIBRARIES})
-endif()
-
-list(APPEND LLDB_SYSTEM_LIBS ${system_libs})
-
-if (LLVM_BUILD_STATIC)
-  if (NOT LLDB_DISABLE_PYTHON)
-    list(APPEND LLDB_SYSTEM_LIBS python2.7 util)
-  endif()
-  if (NOT LLDB_DISABLE_CURSES)
-    list(APPEND LLDB_SYSTEM_LIBS gpm)
-  endif()
-endif()
-
 add_lldb_library(lldbUtility
   ArchSpec.cpp
   Args.cpp
Index: lldb/source/Core/CMakeLists.txt
===================================================================
--- lldb/source/Core/CMakeLists.txt
+++ lldb/source/Core/CMakeLists.txt
@@ -1,10 +1,21 @@
 set(LLDB_CURSES_LIBS)
+set(LLDB_LIBEDIT_LIBS)
 
 if (NOT LLDB_DISABLE_CURSES)
   list(APPEND LLDB_CURSES_LIBS ${CURSES_LIBRARIES})
   if(LLVM_ENABLE_TERMINFO AND HAVE_TERMINFO)
     list(APPEND LLDB_CURSES_LIBS ${TERMINFO_LIBS})
   endif()
+  if (LLVM_BUILD_STATIC)
+    list(APPEND LLDB_CURSES_LIBS gpm)
+  endif()
+endif()
+
+if (NOT LLDB_DISABLE_LIBEDIT)
+  list(APPEND LLDB_LIBEDIT_LIBS ${libedit_LIBRARIES})
+  if (LLVM_BUILD_STATIC)
+    list(APPEND LLDB_SYSTEM_LIBS gpm)
+  endif()
 endif()
 
 add_lldb_library(lldbCore
@@ -67,6 +78,7 @@
     lldbPluginCPlusPlusLanguage
     lldbPluginObjCLanguage
     ${LLDB_CURSES_LIBS}
+    ${LLDB_LIBEDIT_LIBS}
 
   LINK_COMPONENTS
     BinaryFormat


Index: lldb/source/Utility/CMakeLists.txt
===================================================================
--- lldb/source/Utility/CMakeLists.txt
+++ lldb/source/Utility/CMakeLists.txt
@@ -1,46 +1,15 @@
 set(LLDB_SYSTEM_LIBS)
 
-# Windows-only libraries
-if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
-  list(APPEND LLDB_SYSTEM_LIBS
-    ws2_32
-    rpcrt4
-    )
-endif ()
+list(APPEND LLDB_SYSTEM_LIBS ${system_libs})
 
-if (NOT LLDB_DISABLE_LIBEDIT)
-  list(APPEND LLDB_SYSTEM_LIBS ${libedit_LIBRARIES})
-endif()
-if (NOT LLDB_DISABLE_CURSES)
-  list(APPEND LLDB_SYSTEM_LIBS ${CURSES_LIBRARIES})
-  if(LLVM_ENABLE_TERMINFO AND HAVE_TERMINFO)
-    list(APPEND LLDB_SYSTEM_LIBS ${TERMINFO_LIBS})
-  endif()
-endif()
+if (CMAKE_SYSTEM_NAME MATCHES "Windows")
+  list(APPEND LLDB_SYSTEM_LIBS ws2_32 rpcrt4)
+endif ()
 
 if (NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB )
     list(APPEND LLDB_SYSTEM_LIBS atomic)
 endif()
 
-if(Backtrace_FOUND)
-  list(APPEND LLDB_SYSTEM_LIBS ${Backtrace_LIBRARY})
-endif()
-
-if (NOT LLDB_DISABLE_PYTHON AND NOT LLVM_BUILD_STATIC)
-  list(APPEND LLDB_SYSTEM_LIBS ${PYTHON_LIBRARIES})
-endif()
-
-list(APPEND LLDB_SYSTEM_LIBS ${system_libs})
-
-if (LLVM_BUILD_STATIC)
-  if (NOT LLDB_DISABLE_PYTHON)
-    list(APPEND LLDB_SYSTEM_LIBS python2.7 util)
-  endif()
-  if (NOT LLDB_DISABLE_CURSES)
-    list(APPEND LLDB_SYSTEM_LIBS gpm)
-  endif()
-endif()
-
 add_lldb_library(lldbUtility
   ArchSpec.cpp
   Args.cpp
Index: lldb/source/Core/CMakeLists.txt
===================================================================
--- lldb/source/Core/CMakeLists.txt
+++ lldb/source/Core/CMakeLists.txt
@@ -1,10 +1,21 @@
 set(LLDB_CURSES_LIBS)
+set(LLDB_LIBEDIT_LIBS)
 
 if (NOT LLDB_DISABLE_CURSES)
   list(APPEND LLDB_CURSES_LIBS ${CURSES_LIBRARIES})
   if(LLVM_ENABLE_TERMINFO AND HAVE_TERMINFO)
     list(APPEND LLDB_CURSES_LIBS ${TERMINFO_LIBS})
   endif()
+  if (LLVM_BUILD_STATIC)
+    list(APPEND LLDB_CURSES_LIBS gpm)
+  endif()
+endif()
+
+if (NOT LLDB_DISABLE_LIBEDIT)
+  list(APPEND LLDB_LIBEDIT_LIBS ${libedit_LIBRARIES})
+  if (LLVM_BUILD_STATIC)
+    list(APPEND LLDB_SYSTEM_LIBS gpm)
+  endif()
 endif()
 
 add_lldb_library(lldbCore
@@ -67,6 +78,7 @@
     lldbPluginCPlusPlusLanguage
     lldbPluginObjCLanguage
     ${LLDB_CURSES_LIBS}
+    ${LLDB_LIBEDIT_LIBS}
 
   LINK_COMPONENTS
     BinaryFormat
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
  • [Lldb-commits] [PATCH] ... Jonas Devlieghere via Phabricator via lldb-commits

Reply via email to