[Lldb-commits] [PATCH] D61872: [CMake] Simplify lldb-server handling

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon May 13 13:47:19 PDT 2019


JDevlieghere created this revision.
JDevlieghere added reviewers: sgraenitz, labath, davide.
Herald added subscribers: mgorny, srhines.
Herald added a project: LLDB.

We can piggyback off the existing add_lldb_tool_subdirectory to decide whether or not lldb-server should be built.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D61872

Files:
  lldb/cmake/modules/LLDBConfig.cmake
  lldb/tools/CMakeLists.txt
  lldb/unittests/tools/CMakeLists.txt


Index: lldb/unittests/tools/CMakeLists.txt
===================================================================
--- lldb/unittests/tools/CMakeLists.txt
+++ lldb/unittests/tools/CMakeLists.txt
@@ -1,9 +1,6 @@
-add_subdirectory(lldb-mi)
-if(CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|Linux|NetBSD")
-  if ((CMAKE_SYSTEM_NAME MATCHES "Darwin" AND SKIP_TEST_DEBUGSERVER) OR (NOT CMAKE_SYSTEM_NAME MATCHES "Darwin" AND SKIP_LLDB_SERVER_BUILD))
-    # These tests are meant to test lldb-server/debugserver in isolation, and
-    # don't provide any value if run against a server copied from somewhere.
-  else()
-    add_subdirectory(lldb-server)
-  endif()
+if(LLDB_TOOL_LLDB_MI_BUILD)
+  add_subdirectory(lldb-mi)
+endif()
+if(LLDB_TOOL_LLDB_SERVER_BUILD)
+  add_subdirectory(lldb-server)
 endif()
Index: lldb/tools/CMakeLists.txt
===================================================================
--- lldb/tools/CMakeLists.txt
+++ lldb/tools/CMakeLists.txt
@@ -9,13 +9,10 @@
 
 add_lldb_tool_subdirectory(lldb-instr)
 add_lldb_tool_subdirectory(lldb-mi)
+add_lldb_tool_subdirectory(lldb-server)
 add_lldb_tool_subdirectory(lldb-vscode)
 
 if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
   add_subdirectory(darwin-debug)
   add_subdirectory(debugserver)
 endif()
-
-if (LLDB_CAN_USE_LLDB_SERVER AND NOT SKIP_LLDB_SERVER_BUILD)
-  add_subdirectory(lldb-server)
-endif()
Index: lldb/cmake/modules/LLDBConfig.cmake
===================================================================
--- lldb/cmake/modules/LLDBConfig.cmake
+++ lldb/cmake/modules/LLDBConfig.cmake
@@ -419,9 +419,9 @@
 # Figure out if lldb could use lldb-server.  If so, then we'll
 # ensure we build lldb-server when an lldb target is being built.
 if (CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD")
-    set(LLDB_CAN_USE_LLDB_SERVER 1)
+  set(LLDB_TOOL_LLDB_SERVER_BUILD ON)
 else()
-    set(LLDB_CAN_USE_LLDB_SERVER 0)
+  set(LLDB_TOOL_LLDB_SERVER_BUILD OFF)
 endif()
 
 # Figure out if lldb could use debugserver.  If so, then we'll


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61872.199325.patch
Type: text/x-patch
Size: 2005 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190513/2f0be97b/attachment.bin>


More information about the lldb-commits mailing list