aboutsummaryrefslogtreecommitdiff
path: root/lldb/cmake/modules/LLDBConfig.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/cmake/modules/LLDBConfig.cmake')
-rw-r--r--lldb/cmake/modules/LLDBConfig.cmake26
1 files changed, 26 insertions, 0 deletions
diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake
index 8c30b6e..fc84e58 100644
--- a/lldb/cmake/modules/LLDBConfig.cmake
+++ b/lldb/cmake/modules/LLDBConfig.cmake
@@ -323,4 +323,30 @@ else()
set(LLDB_CAN_USE_DEBUGSERVER OFF)
endif()
+# In a cross-compile build, we need to skip building the generated
+# lldb-rpc sources in the first phase of host build so that they can
+# get built using the just-built Clang toolchain in the second phase.
+if (NOT DEFINED LLDB_CAN_USE_LLDB_RPC_SERVER)
+ set(LLDB_CAN_USE_LLDB_RPC_SERVER OFF)
+else()
+ if ((CMAKE_CROSSCOMPILING OR LLVM_HOST_TRIPLE MATCHES "${LLVM_DEFAULT_TARGET_TRIPLE}") AND
+ CMAKE_SYSTEM_NAME MATCHES "AIX|Android|Darwin|FreeBSD|Linux|NetBSD|OpenBSD|Windows")
+ set(LLDB_CAN_USE_LLDB_RPC_SERVER ON)
+ else()
+ set(LLDB_CAN_USE_LLDB_RPC_SERVER OFF)
+ endif()
+endif()
+
+
+if (NOT DEFINED LLDB_BUILD_LLDBRPC)
+ set(LLDB_BUILD_LLDBRPC OFF)
+else()
+ if (CMAKE_CROSSCOMPILING)
+ set(LLDB_BUILD_LLDBRPC OFF CACHE BOOL "")
+ get_host_tool_path(lldb-rpc-gen LLDB_RPC_GEN_EXE lldb_rpc_gen_exe lldb_rpc_gen_target)
+ else()
+ set(LLDB_BUILD_LLDBRPC ON CACHE BOOL "")
+ endif()
+endif()
+
include(LLDBGenerateConfig)