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`.
This commit is contained in:
Saleem Abdulrasool 2019-10-30 12:07:07 -07:00
parent 91e2151d04
commit 5e029c4cfd
1 changed files with 5 additions and 1 deletions

View File

@ -10,7 +10,11 @@
# CFLAGS etc explicitly. Switching on LLVM_HOST_TRIPLE is also an option,
# but it breaks down when cross-compiling.
string(REGEX MATCH "^[^-]*" LLDB_DEBUGSERVER_ARCH "${LLVM_DEFAULT_TARGET_TRIPLE}")
if(LLVM_DEFAULT_TARGET_TRIPLE)
string(REGEX MATCH "^[^-]*" LLDB_DEBUGSERVER_ARCH ${LLVM_DEFAULT_TARGET_TRIPLE})
else()
set(LLDB_DEBUGSERVER_ARCH ${CMAKE_OSX_ARCHITECTURES})
endif()
if("${LLDB_DEBUGSERVER_ARCH}" MATCHES ".*arm.*")
list(APPEND SOURCES arm/DNBArchImpl.cpp arm64/DNBArchImplARM64.cpp)