[CMake] Reinstate LLDB_CAN_USE_LLDB_SERVER

We cannot manipulate the LLDB_TOOL_LLDB_SERVER_BUILD directly from
LLDBConfig.cmake because this would set the variable before the option
is defined in AddLLVM.cmake. Instead, we need to use the
LLDB_CAN_USE_LLDB_SERVER variable to conditionally add the lldb-server
subdirectory. This should ensure the variable doesn't get cleared.

llvm-svn: 360631
This commit is contained in:
Jonas Devlieghere 2019-05-13 22:55:11 +00:00
parent 51e79f0634
commit 1d8b2a0661
2 changed files with 8 additions and 3 deletions

View File

@ -416,8 +416,10 @@ list(APPEND system_libs ${CMAKE_DL_LIBS})
# 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 (NOT CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD")
set(LLDB_TOOL_LLDB_SERVER_BUILD OFF)
if (CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD")
set(LLDB_CAN_USE_LLDB_SERVER 1 INTERNAL)
else()
set(LLDB_CAN_USE_LLDB_SERVER 0 INTERNAL)
endif()
# Figure out if lldb could use debugserver. If so, then we'll

View File

@ -9,10 +9,13 @@ 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)
add_lldb_tool_subdirectory(lldb-server)
endif()