Skip to content

Commit 5e029c4

Browse files
committed
DebugServer: be more lenient about the target triple
When building standalone, `LLVM_DEFAULT_TARGET_TRIPLE` may be undefined. Matching against an empty string does not work as desired in CMake, so, fallback to the old behaviour, defaulting `LLDB_DEBUGSERVER_ARCH` to `CMAKE_OSX_ARCHITECTURES`.
1 parent 91e2151 commit 5e029c4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lldb/tools/debugserver/source/MacOSX/CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
# CFLAGS etc explicitly. Switching on LLVM_HOST_TRIPLE is also an option,
1111
# but it breaks down when cross-compiling.
1212

13-
string(REGEX MATCH "^[^-]*" LLDB_DEBUGSERVER_ARCH "${LLVM_DEFAULT_TARGET_TRIPLE}")
13+
if(LLVM_DEFAULT_TARGET_TRIPLE)
14+
string(REGEX MATCH "^[^-]*" LLDB_DEBUGSERVER_ARCH ${LLVM_DEFAULT_TARGET_TRIPLE})
15+
else()
16+
set(LLDB_DEBUGSERVER_ARCH ${CMAKE_OSX_ARCHITECTURES})
17+
endif()
1418

1519
if("${LLDB_DEBUGSERVER_ARCH}" MATCHES ".*arm.*")
1620
list(APPEND SOURCES arm/DNBArchImpl.cpp arm64/DNBArchImplARM64.cpp)

0 commit comments

Comments
 (0)