[Lldb-commits] [lldb] 5e029c4 - DebugServer: be more lenient about the target triple

Saleem Abdulrasool via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 30 12:09:17 PDT 2019


Author: Saleem Abdulrasool
Date: 2019-10-30T12:08:29-07:00
New Revision: 5e029c4cfd7b8db269b6db475ecd420311fbd7d1

URL: https://github.com/llvm/llvm-project/commit/5e029c4cfd7b8db269b6db475ecd420311fbd7d1
DIFF: https://github.com/llvm/llvm-project/commit/5e029c4cfd7b8db269b6db475ecd420311fbd7d1.diff

LOG: 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`.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/lldb/tools/debugserver/source/MacOSX/CMakeLists.txt b/lldb/tools/debugserver/source/MacOSX/CMakeLists.txt
index 59812b27dff2..cf08985ed6f2 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)


        


More information about the lldb-commits mailing list