summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-05-13 21:25:02 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-05-13 21:25:02 +0000
commitaeeeb37e373700350472d40cf0a0969b070be0a0 (patch)
tree24a39a0ef2fd6c296278582fcb503c043746e868
parent1d662316cbff76cf771b40e889441752d4270553 (diff)
downloadbcm5719-llvm-aeeeb37e373700350472d40cf0a0969b070be0a0.tar.gz
bcm5719-llvm-aeeeb37e373700350472d40cf0a0969b070be0a0.zip
[CMake] Simplify lldb-server handling
We can piggyback off the existing add_lldb_tool_subdirectory to decide whether or not lldb-server should be built. Differential revision: https://reviews.llvm.org/D61872 llvm-svn: 360621
-rw-r--r--lldb/cmake/modules/LLDBConfig.cmake8
-rw-r--r--lldb/tools/CMakeLists.txt5
-rw-r--r--lldb/unittests/tools/CMakeLists.txt13
3 files changed, 8 insertions, 18 deletions
diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake
index b8b047b8792..a330eff6d2f 100644
--- a/lldb/cmake/modules/LLDBConfig.cmake
+++ b/lldb/cmake/modules/LLDBConfig.cmake
@@ -414,14 +414,10 @@ endif()
list(APPEND system_libs ${CMAKE_DL_LIBS})
-SET(SKIP_LLDB_SERVER_BUILD OFF CACHE BOOL "Skip building lldb-server")
-
# 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)
-else()
- set(LLDB_CAN_USE_LLDB_SERVER 0)
+if (NOT CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD")
+ set(LLDB_TOOL_LLDB_SERVER_BUILD OFF)
endif()
# Figure out if lldb could use debugserver. If so, then we'll
diff --git a/lldb/tools/CMakeLists.txt b/lldb/tools/CMakeLists.txt
index 558ef46459c..dbee1dda05d 100644
--- a/lldb/tools/CMakeLists.txt
+++ b/lldb/tools/CMakeLists.txt
@@ -9,13 +9,10 @@ add_subdirectory(lldb-test EXCLUDE_FROM_ALL)
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()
diff --git a/lldb/unittests/tools/CMakeLists.txt b/lldb/unittests/tools/CMakeLists.txt
index 59b87864da5..4c657866ca2 100644
--- a/lldb/unittests/tools/CMakeLists.txt
+++ b/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()
OpenPOWER on IntegriCloud