Author: stefan.graenitz Date: Sat Jul 20 04:18:31 2019 New Revision: 366631
URL: http://llvm.org/viewvc/llvm-project?rev=366631&view=rev Log: [CMake] Align debugserver with lldb-server on Darwin Summary: Make debugserver a tool like lldb-server, so it can be included/excluded via `LLDB_TOOL_DEBUGSERVER_BUILD`. This replaces the old `LLDB_NO_DEBUGSERVER` flag. Doing the same for darwin-debug while I am here. Reviewers: xiaobai, JDevlieghere, davide Reviewed By: xiaobai, JDevlieghere Subscribers: mgorny, lldb-commits, #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D64994 Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake lldb/trunk/test/CMakeLists.txt lldb/trunk/tools/CMakeLists.txt lldb/trunk/unittests/CMakeLists.txt lldb/trunk/unittests/tools/lldb-server/CMakeLists.txt Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=366631&r1=366630&r2=366631&view=diff ============================================================================== --- lldb/trunk/cmake/modules/LLDBConfig.cmake (original) +++ lldb/trunk/cmake/modules/LLDBConfig.cmake Sat Jul 20 04:18:31 2019 @@ -373,17 +373,17 @@ list(APPEND system_libs ${CMAKE_DL_LIBS} # Figure out if lldb could use lldb-server. If so, then we'll # ensure we build lldb-server when an lldb target is being built. if (CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD") - set(LLDB_CAN_USE_LLDB_SERVER 1) + set(LLDB_CAN_USE_LLDB_SERVER ON) else() - set(LLDB_CAN_USE_LLDB_SERVER 0) + set(LLDB_CAN_USE_LLDB_SERVER OFF) endif() # Figure out if lldb could use debugserver. If so, then we'll # ensure we build debugserver when we build lldb. -if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) - set(LLDB_CAN_USE_DEBUGSERVER 1) +if (CMAKE_SYSTEM_NAME MATCHES "Darwin") + set(LLDB_CAN_USE_DEBUGSERVER ON) else() - set(LLDB_CAN_USE_DEBUGSERVER 0) + set(LLDB_CAN_USE_DEBUGSERVER OFF) endif() if (NOT LLDB_DISABLE_CURSES) Modified: lldb/trunk/test/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/CMakeLists.txt?rev=366631&r1=366630&r2=366631&view=diff ============================================================================== --- lldb/trunk/test/CMakeLists.txt (original) +++ lldb/trunk/test/CMakeLists.txt Sat Jul 20 04:18:31 2019 @@ -101,11 +101,18 @@ if(CMAKE_HOST_APPLE) lldb_find_system_debugserver(system_debugserver_path) message(STATUS "LLDB tests use out-of-tree debugserver: ${system_debugserver_path}") list(APPEND LLDB_TEST_COMMON_ARGS --out-of-tree-debugserver) - else() + elseif(TARGET debugserver) set(debugserver_path ${LLVM_RUNTIME_OUTPUT_INTDIR}/debugserver) message(STATUS "LLDB Tests use just-built debugserver: ${debugserver_path}") list(APPEND LLDB_TEST_COMMON_ARGS --server ${debugserver_path}) add_dependencies(lldb-test-deps debugserver) + elseif(TARGET lldb-server) + set(lldb_server_path ${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb-server) + message(STATUS "LLDB Tests use just-built lldb-server: ${lldb_server_path}") + list(APPEND LLDB_TEST_COMMON_ARGS --server ${lldb_server_path}) + add_dependencies(lldb-test-deps lldb-server) + else() + message(WARNING "LLDB Tests enabled, but no server available") endif() endif() Modified: lldb/trunk/tools/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/CMakeLists.txt?rev=366631&r1=366630&r2=366631&view=diff ============================================================================== --- lldb/trunk/tools/CMakeLists.txt (original) +++ lldb/trunk/tools/CMakeLists.txt Sat Jul 20 04:18:31 2019 @@ -11,8 +11,8 @@ add_lldb_tool_subdirectory(lldb-instr) add_lldb_tool_subdirectory(lldb-vscode) if (CMAKE_SYSTEM_NAME MATCHES "Darwin") - add_subdirectory(darwin-debug) - add_subdirectory(debugserver) + add_lldb_tool_subdirectory(darwin-debug) + add_lldb_tool_subdirectory(debugserver) endif() if (LLDB_CAN_USE_LLDB_SERVER) Modified: lldb/trunk/unittests/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/CMakeLists.txt?rev=366631&r1=366630&r2=366631&view=diff ============================================================================== --- lldb/trunk/unittests/CMakeLists.txt (original) +++ lldb/trunk/unittests/CMakeLists.txt Sat Jul 20 04:18:31 2019 @@ -78,6 +78,6 @@ add_subdirectory(tools) add_subdirectory(UnwindAssembly) add_subdirectory(Utility) -if(LLDB_CAN_USE_DEBUGSERVER AND NOT LLDB_USE_SYSTEM_DEBUGSERVER) +if(LLDB_CAN_USE_DEBUGSERVER AND LLDB_TOOL_DEBUGSERVER_BUILD AND NOT LLDB_USE_SYSTEM_DEBUGSERVER) add_subdirectory(debugserver) endif() Modified: lldb/trunk/unittests/tools/lldb-server/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/tools/lldb-server/CMakeLists.txt?rev=366631&r1=366630&r2=366631&view=diff ============================================================================== --- lldb/trunk/unittests/tools/lldb-server/CMakeLists.txt (original) +++ lldb/trunk/unittests/tools/lldb-server/CMakeLists.txt Sat Jul 20 04:18:31 2019 @@ -13,7 +13,7 @@ endfunction() add_lldb_test_executable(thread_inferior inferior/thread_inferior.cpp) add_lldb_test_executable(environment_check inferior/environment_check.cpp) -if(LLDB_CAN_USE_DEBUGSERVER) +if(LLDB_CAN_USE_DEBUGSERVER AND LLDB_TOOL_DEBUGSERVER_BUILD) if(LLDB_USE_SYSTEM_DEBUGSERVER) lldb_find_system_debugserver(debugserver_path) else() _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits