[Lldb-commits] [lldb] af331cb - [debugserver] Set arch based on TARGET_TRIPLE
Vedant Kumar via lldb-commits
lldb-commits at lists.llvm.org
Wed Nov 20 12:12:57 PST 2019
Author: Vedant Kumar
Date: 2019-11-20T12:12:47-08:00
New Revision: af331cbe14e8376c696441bb4c26a68be733b884
URL: https://github.com/llvm/llvm-project/commit/af331cbe14e8376c696441bb4c26a68be733b884
DIFF: https://github.com/llvm/llvm-project/commit/af331cbe14e8376c696441bb4c26a68be733b884.diff
LOG: [debugserver] Set arch based on TARGET_TRIPLE
Use TARGET_TRIPLE instead of LLVM_DEFAULT_TARGET_TRIPLE, as the latter
isn't exported by LLVMConfig.cmake, which means arch detection fails if
lldb is built separately from llvm.
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 cf08985ed6f2..73ba6492a0ef 100644
--- a/lldb/tools/debugserver/source/MacOSX/CMakeLists.txt
+++ b/lldb/tools/debugserver/source/MacOSX/CMakeLists.txt
@@ -1,17 +1,17 @@
# The debugserver build needs to conditionally include files depending on the
# target architecture.
#
-# Switch on the architecture specified by LLVM_DEFAULT_TARGET_TRIPLE, as
+# Switch on the architecture specified by TARGET_TRIPLE, as
# the llvm and swift build systems use this variable to identify the
-# target (the latter, indirectly, through LLVM_HOST_TRIPLE).
+# target (through LLVM_HOST_TRIPLE).
#
# It would be possible to switch on CMAKE_OSX_ARCHITECTURES, but the swift
# build does not provide it, preferring instead to pass arch-specific
# CFLAGS etc explicitly. Switching on LLVM_HOST_TRIPLE is also an option,
# but it breaks down when cross-compiling.
-if(LLVM_DEFAULT_TARGET_TRIPLE)
- string(REGEX MATCH "^[^-]*" LLDB_DEBUGSERVER_ARCH ${LLVM_DEFAULT_TARGET_TRIPLE})
+if(TARGET_TRIPLE)
+ string(REGEX MATCH "^[^-]*" LLDB_DEBUGSERVER_ARCH ${TARGET_TRIPLE})
else()
set(LLDB_DEBUGSERVER_ARCH ${CMAKE_OSX_ARCHITECTURES})
endif()
More information about the lldb-commits
mailing list