From 97ba3b64ddb63b216561b44ea62c0ac8c413feb7 Mon Sep 17 00:00:00 2001 From: Alex Langford Date: Tue, 17 Jul 2018 18:28:51 +0000 Subject: [PATCH] Invert dependency between lldb-framework and lldb-suite Summary: Currently, if you build lldb-framework the entire framework doesn't actually build. In order to build the entire framework, you need to actually build lldb-suite. This abstraction doesn't feel quite right because lldb-framework truly does depend on lldb-suite (liblldb + related tools). In this change I want to invert their dependency. This will mean that lldb and finish_swig will depend on lldb-framework in a framework build, and lldb-suite otherwise. Instead of adding conditional logic everywhere to handle this, I introduce LLDB_SUITE_TARGET to handle it. Differential Revision: https://reviews.llvm.org/D49406 llvm-svn: 337311 --- lldb/CMakeLists.txt | 6 +++--- lldb/cmake/modules/LLDBFramework.cmake | 4 ++-- lldb/source/API/CMakeLists.txt | 6 ++++-- lldb/tools/driver/CMakeLists.txt | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt index 9afe2d6..00ddcdc 100644 --- a/lldb/CMakeLists.txt +++ b/lldb/CMakeLists.txt @@ -40,6 +40,7 @@ endif() # lldb-suite is a dummy target that encompasses all the necessary tools and # libraries for building a fully-functioning liblldb. add_custom_target(lldb-suite) +set(LLDB_SUITE_TARGET lldb-suite) option(LLDB_BUILD_FRAMEWORK "Build the Darwin LLDB.framework" Off) if(LLDB_BUILD_FRAMEWORK) @@ -55,6 +56,7 @@ if(LLDB_BUILD_FRAMEWORK) set(PRODUCT_NAME "LLDB") set(EXECUTABLE_NAME "LLDB") set(CURRENT_PROJECT_VERSION "360.99.0") + set(LLDB_SUITE_TARGET lldb-framework) set(LLDB_FRAMEWORK_DIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_FRAMEWORK_INSTALL_DIR}) @@ -163,9 +165,7 @@ endif() if (LLDB_BUILD_FRAMEWORK) add_custom_target(lldb-framework) include(LLDBFramework) - add_dependencies(lldb-suite lldb-framework) endif() -add_dependencies(lldb-suite liblldb) if (NOT LLDB_DISABLE_PYTHON) # Add a Post-Build Event to copy over Python files and create the symlink @@ -187,7 +187,7 @@ if (NOT LLDB_DISABLE_PYTHON) COMMENT "Python script sym-linking LLDB Python API") # We depend on liblldb and lldb-argdumper being built before we can do this step. - add_dependencies(finish_swig lldb-suite) + add_dependencies(finish_swig ${LLDB_SUITE_TARGET}) # If we build the readline module, we depend on that happening # first. diff --git a/lldb/cmake/modules/LLDBFramework.cmake b/lldb/cmake/modules/LLDBFramework.cmake index a025596..a17f07d 100644 --- a/lldb/cmake/modules/LLDBFramework.cmake +++ b/lldb/cmake/modules/LLDBFramework.cmake @@ -41,5 +41,5 @@ set_target_properties(liblldb PROPERTIES PUBLIC_HEADER "${framework_headers}") add_dependencies(lldb-framework - liblldb - lldb-framework-headers) + lldb-framework-headers + lldb-suite) diff --git a/lldb/source/API/CMakeLists.txt b/lldb/source/API/CMakeLists.txt index 2d417e7..be9d411 100644 --- a/lldb/source/API/CMakeLists.txt +++ b/lldb/source/API/CMakeLists.txt @@ -91,6 +91,8 @@ add_lldb_library(liblldb SHARED Support ) +add_dependencies(lldb-suite liblldb) + if (MSVC) set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY COMPILE_FLAGS " /W0") else() @@ -111,7 +113,7 @@ endif () set_target_properties(liblldb PROPERTIES VERSION ${LLDB_VERSION} - ) +) if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows") if (NOT LLDB_EXPORT_ALL_SYMBOLS) @@ -138,7 +140,7 @@ else() set_target_properties(liblldb PROPERTIES OUTPUT_NAME lldb - ) + ) endif() if (LLDB_WRAP_PYTHON) diff --git a/lldb/tools/driver/CMakeLists.txt b/lldb/tools/driver/CMakeLists.txt index 3fec4c1..9e01a6b 100644 --- a/lldb/tools/driver/CMakeLists.txt +++ b/lldb/tools/driver/CMakeLists.txt @@ -24,4 +24,4 @@ if ( CMAKE_SYSTEM_NAME MATCHES "Windows" ) add_definitions( -DIMPORT_LIBLLDB ) endif() -add_dependencies(lldb lldb-suite) +add_dependencies(lldb ${LLDB_SUITE_TARGET}) -- 2.7.4