diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2019-10-30 12:07:07 -0700 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2019-10-30 12:08:29 -0700 |
commit | 5e029c4cfd7b8db269b6db475ecd420311fbd7d1 (patch) | |
tree | 36d88b05d8e65a1a486c51d01ce53bcc850d1bb3 /lldb/tools/debugserver/source/MacOSX | |
parent | 91e2151d04cc1cf5558f665920bef7df2eb87b40 (diff) | |
download | bcm5719-llvm-5e029c4cfd7b8db269b6db475ecd420311fbd7d1.tar.gz bcm5719-llvm-5e029c4cfd7b8db269b6db475ecd420311fbd7d1.zip |
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`.
Diffstat (limited to 'lldb/tools/debugserver/source/MacOSX')
-rw-r--r-- | lldb/tools/debugserver/source/MacOSX/CMakeLists.txt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lldb/tools/debugserver/source/MacOSX/CMakeLists.txt b/lldb/tools/debugserver/source/MacOSX/CMakeLists.txt index 59812b27dff..cf08985ed6f 100644 --- a/lldb/tools/debugserver/source/MacOSX/CMakeLists.txt +++ b/lldb/tools/debugserver/source/MacOSX/CMakeLists.txt @@ -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) |