This revision was not accepted when it landed; it landed in state "Needs 
Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB351496: [CMake] Prevent lldbDebugserverCommon from 
building if you disable debugserver… (authored by xiaobai, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D56763?vs=182131&id=182407#toc

Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56763/new/

https://reviews.llvm.org/D56763

Files:
  tools/debugserver/source/CMakeLists.txt
  unittests/CMakeLists.txt

Index: unittests/CMakeLists.txt
===================================================================
--- unittests/CMakeLists.txt
+++ unittests/CMakeLists.txt
@@ -78,6 +78,6 @@
 add_subdirectory(UnwindAssembly)
 add_subdirectory(Utility)
 
-if(LLDB_CAN_USE_DEBUGSERVER)
+if(NOT SKIP_TEST_DEBUGSERVER)
   add_subdirectory(debugserver)
 endif()
Index: tools/debugserver/source/CMakeLists.txt
===================================================================
--- tools/debugserver/source/CMakeLists.txt
+++ tools/debugserver/source/CMakeLists.txt
@@ -30,69 +30,6 @@
 
 add_subdirectory(MacOSX)
 
-set(generated_mach_interfaces
-  ${CMAKE_CURRENT_BINARY_DIR}/mach_exc.h
-  ${CMAKE_CURRENT_BINARY_DIR}/mach_excServer.c
-  ${CMAKE_CURRENT_BINARY_DIR}/mach_excUser.c
-  )
-add_custom_command(OUTPUT ${generated_mach_interfaces}
-  COMMAND mig ${CMAKE_CURRENT_SOURCE_DIR}/MacOSX/dbgnub-mig.defs
-  DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/MacOSX/dbgnub-mig.defs
-  )
-
-set(DEBUGSERVER_VERS_GENERATED_FILE ${CMAKE_CURRENT_BINARY_DIR}/debugserver_vers.c)
-set_source_files_properties(${DEBUGSERVER_VERS_GENERATED_FILE} PROPERTIES GENERATED 1)
-
-add_custom_command(OUTPUT ${DEBUGSERVER_VERS_GENERATED_FILE}
-  COMMAND ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl
-          ${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj debugserver
-          > ${DEBUGSERVER_VERS_GENERATED_FILE}
-  DEPENDS ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl
-          ${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj
-  )
-
-set(lldbDebugserverCommonSources
-  DNBArch.cpp
-  DNBBreakpoint.cpp
-  DNB.cpp
-  DNBDataRef.cpp
-  DNBError.cpp
-  DNBLog.cpp
-  DNBRegisterInfo.cpp
-  DNBThreadResumeActions.cpp
-  JSON.cpp
-  StdStringExtractor.cpp
-  # JSON reader depends on the following LLDB-common files
-  ${LLDB_SOURCE_DIR}/source/Host/common/StringConvert.cpp
-  ${LLDB_SOURCE_DIR}/source/Host/common/SocketAddress.cpp
-  # end JSON reader dependencies
-  libdebugserver.cpp
-  PseudoTerminal.cpp
-  PThreadEvent.cpp
-  PThreadMutex.cpp
-  RNBContext.cpp
-  RNBRemote.cpp
-  RNBServices.cpp
-  RNBSocket.cpp
-  SysSignal.cpp
-  TTYState.cpp
-
-  MacOSX/CFBundle.cpp
-  MacOSX/CFString.cpp
-  MacOSX/Genealogy.cpp
-  MacOSX/MachException.cpp
-  MacOSX/MachProcess.mm
-  MacOSX/MachTask.mm
-  MacOSX/MachThread.cpp
-  MacOSX/MachThreadList.cpp
-  MacOSX/MachVMMemory.cpp
-  MacOSX/MachVMRegion.cpp
-  MacOSX/OsLogger.cpp
-  ${generated_mach_interfaces}
-  ${DEBUGSERVER_VERS_GENERATED_FILE})
-
-add_library(lldbDebugserverCommon ${lldbDebugserverCommonSources})
-
 # LLDB-specific identity, currently used for code signing debugserver.
 set(LLDB_CODESIGN_IDENTITY "" CACHE STRING
     "Override code sign identity for debugserver and for use in tests; falls back to LLVM_CODESIGNING_IDENTITY if set or lldb_codesign otherwise (Darwin only)")
@@ -241,6 +178,69 @@
 endif()
 
 if(build_and_sign_debugserver)
+  set(generated_mach_interfaces
+    ${CMAKE_CURRENT_BINARY_DIR}/mach_exc.h
+    ${CMAKE_CURRENT_BINARY_DIR}/mach_excServer.c
+    ${CMAKE_CURRENT_BINARY_DIR}/mach_excUser.c
+    )
+  add_custom_command(OUTPUT ${generated_mach_interfaces}
+    COMMAND mig ${CMAKE_CURRENT_SOURCE_DIR}/MacOSX/dbgnub-mig.defs
+    DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/MacOSX/dbgnub-mig.defs
+    )
+
+  set(DEBUGSERVER_VERS_GENERATED_FILE ${CMAKE_CURRENT_BINARY_DIR}/debugserver_vers.c)
+  set_source_files_properties(${DEBUGSERVER_VERS_GENERATED_FILE} PROPERTIES GENERATED 1)
+
+  add_custom_command(OUTPUT ${DEBUGSERVER_VERS_GENERATED_FILE}
+    COMMAND ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl
+            ${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj debugserver
+            > ${DEBUGSERVER_VERS_GENERATED_FILE}
+    DEPENDS ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl
+            ${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj
+    )
+
+  set(lldbDebugserverCommonSources
+    DNBArch.cpp
+    DNBBreakpoint.cpp
+    DNB.cpp
+    DNBDataRef.cpp
+    DNBError.cpp
+    DNBLog.cpp
+    DNBRegisterInfo.cpp
+    DNBThreadResumeActions.cpp
+    JSON.cpp
+    StdStringExtractor.cpp
+    # JSON reader depends on the following LLDB-common files
+    ${LLDB_SOURCE_DIR}/source/Host/common/StringConvert.cpp
+    ${LLDB_SOURCE_DIR}/source/Host/common/SocketAddress.cpp
+    # end JSON reader dependencies
+    libdebugserver.cpp
+    PseudoTerminal.cpp
+    PThreadEvent.cpp
+    PThreadMutex.cpp
+    RNBContext.cpp
+    RNBRemote.cpp
+    RNBServices.cpp
+    RNBSocket.cpp
+    SysSignal.cpp
+    TTYState.cpp
+
+    MacOSX/CFBundle.cpp
+    MacOSX/CFString.cpp
+    MacOSX/Genealogy.cpp
+    MacOSX/MachException.cpp
+    MacOSX/MachProcess.mm
+    MacOSX/MachTask.mm
+    MacOSX/MachThread.cpp
+    MacOSX/MachThreadList.cpp
+    MacOSX/MachVMMemory.cpp
+    MacOSX/MachVMRegion.cpp
+    MacOSX/OsLogger.cpp
+    ${generated_mach_interfaces}
+    ${DEBUGSERVER_VERS_GENERATED_FILE})
+
+  add_library(lldbDebugserverCommon ${lldbDebugserverCommonSources})
+
   target_link_libraries(lldbDebugserverCommon
                         INTERFACE ${COCOA_LIBRARY}
                         ${CORE_FOUNDATION_LIBRARY}
@@ -267,6 +267,7 @@
     ENTITLEMENTS
       ${entitlements}
     )
+
   if(IOS)
     set_property(TARGET lldbDebugserverCommon APPEND PROPERTY COMPILE_DEFINITIONS
       WITH_LOCKDOWN
@@ -281,30 +282,28 @@
     set_property(TARGET lldbDebugserverCommon APPEND PROPERTY COMPILE_FLAGS
       -F${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks
       )
-  endif()
-endif()
 
-if(IOS)
-  add_library(lldbDebugserverCommon_NonUI ${lldbDebugserverCommonSources})
-  target_link_libraries(lldbDebugserverCommon_NonUI
-                      INTERFACE ${COCOA_LIBRARY}
-                      ${CORE_FOUNDATION_LIBRARY}
-                      ${FOUNDATION_LIBRARY}
-                      lldbDebugserverArchSupport
-                      lldbDebugserverDarwin_DarwinLog
-                      ${LIBCOMPRESSION})
-  if(HAVE_LIBCOMPRESSION)
-    set_property(TARGET lldbDebugserverCommon_NonUI APPEND PROPERTY
-                 COMPILE_DEFINITIONS HAVE_LIBCOMPRESSION)
-  endif()
+    add_library(lldbDebugserverCommon_NonUI ${lldbDebugserverCommonSources})
+    target_link_libraries(lldbDebugserverCommon_NonUI
+                        INTERFACE ${COCOA_LIBRARY}
+                        ${CORE_FOUNDATION_LIBRARY}
+                        ${FOUNDATION_LIBRARY}
+                        lldbDebugserverArchSupport
+                        lldbDebugserverDarwin_DarwinLog
+                        ${LIBCOMPRESSION})
+    if(HAVE_LIBCOMPRESSION)
+      set_property(TARGET lldbDebugserverCommon_NonUI APPEND PROPERTY
+                   COMPILE_DEFINITIONS HAVE_LIBCOMPRESSION)
+    endif()
 
-  add_lldb_tool(debugserver-nonui
-    debugserver.cpp
+    add_lldb_tool(debugserver-nonui
+      debugserver.cpp
 
-    LINK_LIBS
-      lldbDebugserverCommon_NonUI
+      LINK_LIBS
+        lldbDebugserverCommon_NonUI
 
-    ENTITLEMENTS
-      ${entitlements}
-    )
+      ENTITLEMENTS
+        ${entitlements}
+      )
+  endif()
 endif()
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to