[Lldb-commits] [lldb] 510758d - debugserver: Pass -arch flags to mig invocation as needed

Vedant Kumar via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 17 13:12:04 PST 2020


Author: Vedant Kumar
Date: 2020-01-17T13:11:54-08:00
New Revision: 510758dae2a8fa4b0b26dea89d4d1efd576b8ad6

URL: https://github.com/llvm/llvm-project/commit/510758dae2a8fa4b0b26dea89d4d1efd576b8ad6
DIFF: https://github.com/llvm/llvm-project/commit/510758dae2a8fa4b0b26dea89d4d1efd576b8ad6.diff

LOG: debugserver: Pass -arch flags to mig invocation as needed

Specify -isysroot and any necessary -arch flags in the `mig` invocation
when CMAKE_OSX_ARCHITECTURES is set (needed for the bridgeOS build).

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/lldb/tools/debugserver/source/CMakeLists.txt b/lldb/tools/debugserver/source/CMakeLists.txt
index 607ac11ac96f..5b604126e47d 100644
--- a/lldb/tools/debugserver/source/CMakeLists.txt
+++ b/lldb/tools/debugserver/source/CMakeLists.txt
@@ -132,8 +132,15 @@ set(generated_mach_interfaces
   ${CMAKE_CURRENT_BINARY_DIR}/mach_excServer.c
   ${CMAKE_CURRENT_BINARY_DIR}/mach_excUser.c
   )
+
+set(MIG_ARCH_FLAGS "")
+foreach(ARCH ${CMAKE_OSX_ARCHITECTURES})
+  set(MIG_ARCH_FLAGS "${MIG_ARCH_FLAGS} -arch ${ARCH}")
+endforeach()
+separate_arguments(MIG_ARCH_FLAGS_SEPARTED NATIVE_COMMAND "${MIG_ARCH_FLAGS}")
+
 add_custom_command(OUTPUT ${generated_mach_interfaces}
-  COMMAND mig ${CMAKE_CURRENT_SOURCE_DIR}/MacOSX/dbgnub-mig.defs
+  VERBATIM COMMAND mig ${MIG_ARCH_FLAGS_SEPARTED} -isysroot ${CMAKE_OSX_SYSROOT} ${CMAKE_CURRENT_SOURCE_DIR}/MacOSX/dbgnub-mig.defs
   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/MacOSX/dbgnub-mig.defs
   )
 


        


More information about the lldb-commits mailing list