diff options
Diffstat (limited to 'cmake/modules/AddLLDB.cmake')
| -rw-r--r-- | cmake/modules/AddLLDB.cmake | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/cmake/modules/AddLLDB.cmake b/cmake/modules/AddLLDB.cmake index 2fd8b384d9e3..129a5ef7500d 100644 --- a/cmake/modules/AddLLDB.cmake +++ b/cmake/modules/AddLLDB.cmake @@ -86,7 +86,7 @@ endfunction(add_lldb_library) function(add_lldb_executable name) cmake_parse_arguments(ARG - "INCLUDE_IN_FRAMEWORK;GENERATE_INSTALL" + "INCLUDE_IN_SUITE;GENERATE_INSTALL" "" "LINK_LIBS;LINK_COMPONENTS" ${ARGN} @@ -99,8 +99,9 @@ function(add_lldb_executable name) set_target_properties(${name} PROPERTIES FOLDER "lldb executables") - if(LLDB_BUILD_FRAMEWORK) - if(ARG_INCLUDE_IN_FRAMEWORK) + if(ARG_INCLUDE_IN_SUITE) + add_dependencies(lldb-suite ${name}) + if(LLDB_BUILD_FRAMEWORK) if(NOT IOS) set(resource_dir "/Resources") set(resource_dots "../") @@ -110,29 +111,23 @@ function(add_lldb_executable name) RUNTIME_OUTPUT_DIRECTORY $<TARGET_FILE_DIR:liblldb>${resource_dir} BUILD_WITH_INSTALL_RPATH On INSTALL_RPATH "@loader_path/../../../${resource_dots}${_dots}/${LLDB_FRAMEWORK_INSTALL_DIR}") - # For things inside the framework we don't need functional install targets - # because CMake copies the resources and headers from the build directory. - # But we still need this target to exist in order to use the - # LLVM_DISTRIBUTION_COMPONENTS build option. We also need the - # install-liblldb target to depend on this tool, so that it gets put into - # the Resources directory before the framework is installed. - if(ARG_GENERATE_INSTALL) - add_custom_target(install-${name} DEPENDS ${name}) - add_dependencies(install-liblldb ${name}) - add_custom_target(install-${name}-stripped DEPENDS ${name}) - add_dependencies(install-liblldb-stripped ${name}) - endif() - else() - set_target_properties(${name} PROPERTIES - BUILD_WITH_INSTALL_RPATH On - INSTALL_RPATH "@loader_path/../${LLDB_FRAMEWORK_INSTALL_DIR}") endif() endif() - if(ARG_GENERATE_INSTALL AND NOT (ARG_INCLUDE_IN_FRAMEWORK AND LLDB_BUILD_FRAMEWORK )) + if(LLDB_BUILD_FRAMEWORK AND NOT ARG_INCLUDE_IN_SUITE) + set_target_properties(${name} PROPERTIES + BUILD_WITH_INSTALL_RPATH On + INSTALL_RPATH "@loader_path/../${LLDB_FRAMEWORK_INSTALL_DIR}") + endif() + + if(ARG_GENERATE_INSTALL) + set(out_dir "bin") + if (LLDB_BUILD_FRAMEWORK AND ARG_INCLUDE_IN_SUITE) + set(out_dir ${LLDB_FRAMEWORK_INSTALL_DIR}/${LLDB_FRAMEWORK_RESOURCE_DIR}) + endif() install(TARGETS ${name} COMPONENT ${name} - RUNTIME DESTINATION bin) + RUNTIME DESTINATION ${out_dir}) if (NOT CMAKE_CONFIGURATION_TYPES) add_llvm_install_targets(install-${name} DEPENDS ${name} @@ -140,7 +135,7 @@ function(add_lldb_executable name) endif() endif() - if(ARG_INCLUDE_IN_FRAMEWORK AND LLDB_BUILD_FRAMEWORK) + if(ARG_INCLUDE_IN_SUITE AND LLDB_BUILD_FRAMEWORK) add_llvm_tool_symlink(${name} ${name} ALWAYS_GENERATE SKIP_INSTALL OUTPUT_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) endif() |
