summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Langford <apl@fb.com>2019-01-17 23:14:04 +0000
committerAlex Langford <apl@fb.com>2019-01-17 23:14:04 +0000
commitcb1c467edb2ce56c93cf6429cf2faffca7df5252 (patch)
tree50d19b5482c2fac9a9031c870c76bc1ae9dc6ff5
parent26e4cef093fee48f567eb7f8dfe386b3804466de (diff)
downloadbcm5719-llvm-cb1c467edb2ce56c93cf6429cf2faffca7df5252.tar.gz
bcm5719-llvm-cb1c467edb2ce56c93cf6429cf2faffca7df5252.zip
[CMake] Prevent lldbDebugserverCommon from building if you disable debugserver builds
Summary: The flags `LLDB_USE_SYSTEM_DEBUGSERVER` and `LLDB_NO_DEBUGSERVER` were introduced to the debugserver build. If one of these two flags are set, then we do not build and sign debugserver. However I noticed that we were still building the lldbDebugserverCommon and lldbDebugserverCommon_NonUI libraries regardless of whether or not these flags were set. I don't believe we should be building these libraries unless we are building and signing debugserver. Reviewers: sgraenitz, davide, JDevlieghere, beanz, vsk, aprantl, labath Subscribers: mgorny, jfb, lldb-commits Differential Revision: https://reviews.llvm.org/D56763 llvm-svn: 351496
-rw-r--r--lldb/tools/debugserver/source/CMakeLists.txt169
-rw-r--r--lldb/unittests/CMakeLists.txt2
2 files changed, 85 insertions, 86 deletions
diff --git a/lldb/tools/debugserver/source/CMakeLists.txt b/lldb/tools/debugserver/source/CMakeLists.txt
index 860a0289d22..bbc2984c59a 100644
--- a/lldb/tools/debugserver/source/CMakeLists.txt
+++ b/lldb/tools/debugserver/source/CMakeLists.txt
@@ -30,69 +30,6 @@ check_library_exists(compression compression_encode_buffer "" HAVE_LIBCOMPRESSIO
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 @@ if(LLDB_USE_ENTITLEMENTS)
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 @@ if(build_and_sign_debugserver)
ENTITLEMENTS
${entitlements}
)
+
if(IOS)
set_property(TARGET lldbDebugserverCommon APPEND PROPERTY COMPILE_DEFINITIONS
WITH_LOCKDOWN
@@ -281,30 +282,28 @@ if(build_and_sign_debugserver)
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()
diff --git a/lldb/unittests/CMakeLists.txt b/lldb/unittests/CMakeLists.txt
index 1ffae834dfb..db12d5e0492 100644
--- a/lldb/unittests/CMakeLists.txt
+++ b/lldb/unittests/CMakeLists.txt
@@ -78,6 +78,6 @@ add_subdirectory(tools)
add_subdirectory(UnwindAssembly)
add_subdirectory(Utility)
-if(LLDB_CAN_USE_DEBUGSERVER)
+if(NOT SKIP_TEST_DEBUGSERVER)
add_subdirectory(debugserver)
endif()
OpenPOWER on IntegriCloud