Index: CMakeLists.txt =================================================================== --- CMakeLists.txt +++ CMakeLists.txt @@ -28,46 +28,10 @@ add_definitions(-DLLDB_USE_OS_LOG) 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) - -if(LLDB_BUILD_FRAMEWORK) - add_custom_target(lldb-framework) - - # These are used to fill out LLDB-Info.plist. These are relevant when building - # the framework, and must be defined before building liblldb. - set(PRODUCT_NAME "LLDB") - set(EXECUTABLE_NAME "LLDB") - set(CURRENT_PROJECT_VERSION "${LLDB_VERSION_MAJOR}.${LLDB_VERSION_MINOR}.${LLDB_VERSION_PATCH}") - set(LLDB_SUITE_TARGET lldb-framework) - - set(LLDB_FRAMEWORK_DIR - ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_FRAMEWORK_INSTALL_DIR}) - include(LLDBFramework) -endif() - add_subdirectory(docs) if (NOT LLDB_DISABLE_PYTHON) - if(LLDB_USE_SYSTEM_SIX) - set(SIX_EXTRA_ARGS "--useSystemSix") - endif() - - set(LLDB_PYTHON_TARGET_DIR ${LLDB_BINARY_DIR}/scripts) - set(LLDB_WRAP_PYTHON ${LLDB_BINARY_DIR}/scripts/LLDBWrapPython.cpp) - if(LLDB_BUILD_FRAMEWORK) - set(LLDB_PYTHON_TARGET_DIR ${LLDB_FRAMEWORK_DIR}) - set(LLDB_WRAP_PYTHON ${LLDB_PYTHON_TARGET_DIR}/LLDBWrapPython.cpp) - else() - # Don't set -m when building the framework. - set(FINISH_EXTRA_ARGS "-m") - endif() - - add_subdirectory(scripts) endif () - add_subdirectory(source) add_subdirectory(tools) @@ -153,8 +117,14 @@ add_subdirectory(utils/lldb-dotest) endif() - if (NOT LLDB_DISABLE_PYTHON) + if(NOT LLDB_BUILD_FRAMEWORK) + set(use_python_wrapper_from_src_dir -m) + endif() + if(LLDB_USE_SYSTEM_SIX) + set(use_six_py_from_system --useSystemSix) + endif() + # Add a Post-Build Event to copy over Python files and create the symlink # to liblldb.so for the Python API(hardlink on Windows) add_custom_target(finish_swig ALL @@ -166,29 +136,24 @@ --prefix=${CMAKE_BINARY_DIR} --cmakeBuildConfiguration=${CMAKE_CFG_INTDIR} --lldbLibDir=lib${LLVM_LIBDIR_SUFFIX} - ${SIX_EXTRA_ARGS} - ${FINISH_EXTRA_ARGS} + ${use_python_wrapper_from_src_dir} + ${use_six_py_from_system} VERBATIM DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/finishSwigWrapperClasses.py DEPENDS ${LLDB_PYTHON_TARGET_DIR}/lldb.py 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_TARGET}) - # If we build the readline module, we depend on that happening - # first. if (TARGET readline) - add_dependencies(finish_swig readline) + set(readline_dep readline) endif() + add_dependencies(finish_swig swig_wrapper liblldb lldb-argdumper ${readline_dep}) # Ensure we do the python post-build step when building lldb. add_dependencies(lldb finish_swig) - if (LLDB_BUILD_FRAMEWORK) - # The target to install libLLDB needs to depend on finish_swig so that the - # framework build properly copies over the Python files. - add_dependencies(install-liblldb finish_swig) + if(LLDB_BUILD_FRAMEWORK) + add_dependencies(lldb-framework finish_swig) endif() # Add a Post-Build Event to copy the custom Python DLL to the lldb binaries dir so that Windows can find it when launching Index: cmake/modules/AddLLDB.cmake =================================================================== --- cmake/modules/AddLLDB.cmake +++ cmake/modules/AddLLDB.cmake @@ -50,20 +50,20 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "liblldb") if (PARAM_SHARED) - set(out_dir lib${LLVM_LIBDIR_SUFFIX}) if(${name} STREQUAL "liblldb" AND LLDB_BUILD_FRAMEWORK) - set(out_dir ${LLDB_FRAMEWORK_INSTALL_DIR}) - # The framework that is generated will install with install-liblldb - # because we enable CMake's framework support. CMake will copy all the - # headers and resources for us. - add_dependencies(install-lldb-framework install-${name}) - add_dependencies(install-lldb-framework-stripped install-${name}-stripped) + if(LLDB_FRAMEWORK_INSTALL_DIR) + set(install_dir ${LLDB_FRAMEWORK_INSTALL_DIR}) + else() + set(install_dir ".") + endif() + else() + set(install_dir lib${LLVM_LIBDIR_SUFFIX}) endif() install(TARGETS ${name} COMPONENT ${name} RUNTIME DESTINATION bin - LIBRARY DESTINATION ${out_dir} - ARCHIVE DESTINATION ${out_dir}) + LIBRARY DESTINATION ${install_dir} + ARCHIVE DESTINATION ${install_dir}) else() install(TARGETS ${name} COMPONENT ${name} @@ -74,13 +74,6 @@ add_llvm_install_targets(install-${name} DEPENDS $ COMPONENT ${name}) - - # install-liblldb{,-stripped} is the actual target that will install the - # framework, so it must rely on the framework being fully built first. - if (LLDB_BUILD_FRAMEWORK AND ${name} STREQUAL "liblldb") - add_dependencies(install-${name} lldb-framework) - add_dependencies(install-${name}-stripped lldb-framework) - endif() endif() endif() endif() @@ -99,7 +92,7 @@ function(add_lldb_executable name) cmake_parse_arguments(ARG - "INCLUDE_IN_SUITE;GENERATE_INSTALL" + "GENERATE_INSTALL" "ENTITLEMENTS" "LINK_LIBS;LINK_COMPONENTS" ${ARGN} @@ -109,53 +102,18 @@ add_llvm_executable(${name} ${ARG_UNPARSED_ARGUMENTS} ENTITLEMENTS ${ARG_ENTITLEMENTS}) target_link_libraries(${name} PRIVATE ${ARG_LINK_LIBS}) - set_target_properties(${name} PROPERTIES - FOLDER "lldb executables") - - if(ARG_INCLUDE_IN_SUITE) - add_dependencies(lldb-suite ${name}) - if(LLDB_BUILD_FRAMEWORK) - if(NOT IOS) - set(resource_dir "/Resources") - set(resource_dots "../") - endif() - string(REGEX REPLACE "[^/]+" ".." _dots ${LLDB_FRAMEWORK_INSTALL_DIR}) - set_target_properties(${name} PROPERTIES - RUNTIME_OUTPUT_DIRECTORY $${resource_dir} - BUILD_WITH_INSTALL_RPATH On - INSTALL_RPATH "@loader_path/../../../${resource_dots}${_dots}/${LLDB_FRAMEWORK_INSTALL_DIR}") - endif() - endif() - - 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() + set_target_properties(${name} PROPERTIES FOLDER "lldb executables") 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}) - # While install-liblldb-stripped will handle copying the tools, it will - # not strip them. We depend on this target to guarantee a stripped version - # will get installed in the framework. - add_dependencies(install-lldb-framework-stripped install-${name}-stripped) - endif() install(TARGETS ${name} - COMPONENT ${name} - RUNTIME DESTINATION ${out_dir}) + COMPONENT ${name} + RUNTIME DESTINATION bin) if (NOT CMAKE_CONFIGURATION_TYPES) add_llvm_install_targets(install-${name} DEPENDS ${name} COMPONENT ${name}) endif() endif() - - 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() endfunction(add_lldb_executable) function(add_lldb_tool name) Index: cmake/modules/LLDBConfig.cmake =================================================================== --- cmake/modules/LLDBConfig.cmake +++ cmake/modules/LLDBConfig.cmake @@ -4,6 +4,18 @@ set(LLDB_SOURCE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/source") set(LLDB_INCLUDE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/include") +set(LLDB_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) +set(LLDB_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) + +if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) + message(FATAL_ERROR + "In-source builds are not allowed. CMake would overwrite the makefiles " + "distributed with LLDB. Please create a directory and run cmake from " + "there, passing the path to this source directory as the last argument. " + "This process created the file `CMakeCache.txt' and the directory " + "`CMakeFiles'. Please delete them.") +endif() + set(LLDB_LINKER_SUPPORTS_GROUPS OFF) if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darwin") # The Darwin linker doesn't understand --start-group/--end-group. @@ -37,6 +49,13 @@ option(LLDB_BUILD_FRAMEWORK "Build LLDB.framework (Darwin only)" OFF) option(LLDB_USE_ENTITLEMENTS "When codesigning, use entitlements if available" ON) +set(LLDB_CODESIGN_IDENTITY lldb_codesign CACHE STRING + "Identity for code signing debugserver (Darwin only)") + +if(LLDB_CODESIGN_IDENTITY) + set(LLVM_CODESIGNING_IDENTITY ${LLDB_CODESIGN_IDENTITY} CACHE STRING "" FORCE) +endif() + if(LLDB_BUILD_FRAMEWORK) if(NOT APPLE) message(FATAL_ERROR "LLDB.framework can only be generated when targeting Apple platforms") @@ -45,6 +64,19 @@ if(CMAKE_VERSION VERSION_LESS 3.7) message(FATAL_ERROR "LLDB_BUILD_FRAMEWORK is not supported on CMake < 3.7") endif() + + set(LLDB_FRAMEWORK_VERSION A CACHE STRING "LLDB.framework version (default is A)") + set(LLDB_FRAMEWORK_BUILD_DIR bin CACHE STRING "Output directory for LLDB.framework") + set(LLDB_FRAMEWORK_INSTALL_DIR Library/Frameworks CACHE STRING "Install directory for LLDB.framework") + set(LLDB_FRAMEWORK_TOOLS darwin-debug;debugserver;lldb-argdumper;lldb-server CACHE INTERNAL + "List of tools to include in LLDB.framework/Resources") + + # Set decicated directory for all dSYMs. Essentially, this emits the + # framework's dSYM outside of the framework directory. + if(LLVM_EXTERNALIZE_DEBUGINFO) + set(LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin CACHE STRING + "Directory to emit dSYM files stripped from executables and libraries (Darwin Only)") + endif() endif() if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows") @@ -64,14 +96,6 @@ add_definitions( -DLLDB_DISABLE_CURSES ) endif() -option(LLDB_USE_ENTITLEMENTS "When code signing, use entitlements if available" ON) -set(LLDB_CODESIGN_IDENTITY lldb_codesign CACHE STRING - "Identity for code signing debugserver (Darwin only)") - -if(LLDB_CODESIGN_IDENTITY) - set(LLVM_CODESIGNING_IDENTITY ${LLDB_CODESIGN_IDENTITY} CACHE STRING "" FORCE) -endif() - # On Windows, we can't use the normal FindPythonLibs module that comes with CMake, # for a number of reasons. # 1) Prior to MSVC 2015, it is only possible to embed Python if python itself was @@ -276,17 +300,6 @@ add_definitions( -D_UNICODE -DUNICODE ) endif() -set(LLDB_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) -set(LLDB_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) - -if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) - message(FATAL_ERROR "In-source builds are not allowed. CMake would overwrite " -"the makefiles distributed with LLDB. Please create a directory and run cmake " -"from there, passing the path to this source directory as the last argument. " -"This process created the file `CMakeCache.txt' and the directory " -"`CMakeFiles'. Please delete them.") -endif() - # If LLDB_VERSION_* is specified, use it, if not use LLVM_VERSION_*. if(NOT DEFINED LLDB_VERSION_MAJOR) set(LLDB_VERSION_MAJOR ${LLVM_VERSION_MAJOR}) @@ -356,11 +369,6 @@ find_library(CORE_FOUNDATION_LIBRARY CoreFoundation) find_library(SECURITY_LIBRARY Security) - set(LLDB_FRAMEWORK_INSTALL_DIR Library/Frameworks CACHE STRING "Output directory for LLDB.framework") - set(LLDB_FRAMEWORK_VERSION A CACHE STRING "LLDB.framework version (default is A)") - set(LLDB_FRAMEWORK_RESOURCE_DIR - LLDB.framework/Versions/${LLDB_FRAMEWORK_VERSION}/Resources) - add_definitions( -DLIBXML2_DEFINED ) list(APPEND system_libs xml2 ${CURSES_LIBRARIES} Index: cmake/modules/LLDBFramework.cmake =================================================================== --- cmake/modules/LLDBFramework.cmake +++ cmake/modules/LLDBFramework.cmake @@ -1,39 +1,132 @@ +# Path relative to the root binary directory +get_filename_component( + framework_target_dir ${LLDB_FRAMEWORK_BUILD_DIR} ABSOLUTE + BASE_DIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR} +) + +message(STATUS "LLDB.framework: build path is '${framework_target_dir}'") +message(STATUS "LLDB.framework: install path is '${LLDB_FRAMEWORK_INSTALL_DIR}'") +message(STATUS "LLDB.framework: resources subdirectory is 'Versions/${LLDB_FRAMEWORK_VERSION}/Resources'") + +# Configure liblldb as a framework bundle +set_target_properties(liblldb PROPERTIES + FRAMEWORK ON + FRAMEWORK_VERSION ${LLDB_FRAMEWORK_VERSION} + + OUTPUT_NAME LLDB + VERSION ${LLDB_VERSION} + LIBRARY_OUTPUT_DIRECTORY ${framework_target_dir} + + # Compatibility version + SOVERSION "1.0.0" + + MACOSX_FRAMEWORK_IDENTIFIER com.apple.LLDB.framework + MACOSX_FRAMEWORK_BUNDLE_VERSION ${LLDB_VERSION} + MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${LLDB_VERSION} + MACOSX_FRAMEWORK_INFO_PLIST ${LLDB_SOURCE_DIR}/resources/LLDB-Info.plist.in +) + +# Affects the layout of the framework bundle (default is macOS layout). +if(IOS) + set_target_properties(liblldb PROPERTIES + XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "${IPHONEOS_DEPLOYMENT_TARGET}") +else() + set_target_properties(liblldb PROPERTIES + XCODE_ATTRIBUTE_MACOSX_DEPLOYMENT_TARGET "${MACOSX_DEPLOYMENT_TARGET}") +endif() + +# Target to capture extra steps for a fully functional framework bundle. +add_custom_target(lldb-framework) + +# Dependencies are defined once tools are added (see AddLLDB.cmake) +if(LLDB_FRAMEWORK_TOOLS) + foreach(tool ${LLDB_FRAMEWORK_TOOLS}) + add_custom_command(TARGET lldb-framework POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy $ $/Resources + COMMENT "LLDB.framework: copy additional tool ${tool}" + ) + endforeach() +else() + message(WARNING "LLDB.framework: no additional tools configured (set via LLDB_FRAMEWORK_TOOLS)") +endif() + +# Apart from this one, CMake creates all required symlinks in the framework bundle. +add_custom_command(TARGET lldb-framework POST_BUILD + COMMAND ${CMAKE_COMMAND} -E create_symlink + $/Headers + ${framework_target_dir}/LLDB.framework/Headers + COMMENT "LLDB.framework: create Headers symlink" +) + +# At configuration time, collect headers for the framework bundle and copy them +# into a staging directory. Later we can copy over the entire folder. file(GLOB public_headers ${LLDB_SOURCE_DIR}/include/lldb/API/*.h) file(GLOB root_public_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-*.h) file(GLOB root_private_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-private*.h) list(REMOVE_ITEM root_public_headers ${root_private_headers}) + +set(lldb_header_staging ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders) foreach(header ${public_headers} ${root_public_headers} ${LLDB_SOURCE_DIR}/include/lldb/Utility/SharingPtr.h) + get_filename_component(basename ${header} NAME) - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename} - DEPENDS ${header} - COMMAND ${CMAKE_COMMAND} -E copy ${header} ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename}) - list(APPEND framework_headers ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename}) + set(staged_header ${lldb_header_staging}/${basename}) + + add_custom_command( + DEPENDS ${header} OUTPUT ${staged_header} + COMMAND ${CMAKE_COMMAND} -E copy ${header} ${staged_header} + COMMENT "LLDB.framework: collect framework header") + + list(APPEND lldb_staged_headers ${staged_header}) endforeach() -add_custom_target(lldb-framework-headers DEPENDS ${framework_headers}) +# Wrap output in a target, so lldb-framework can depend on it. +add_custom_target(lldb-framework-headers DEPENDS ${lldb_staged_headers}) -add_custom_command(TARGET lldb-framework POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders $/Headers +# At build time, copy the staged headers into the framework bundle (and do +# some post-processing in-place). +add_custom_command(TARGET lldb-framework-headers POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory ${lldb_header_staging} $/Headers COMMAND ${LLDB_SOURCE_DIR}/scripts/framework-header-fix.sh $/Headers ${LLDB_VERSION} + COMMENT "LLDB.framework: copy framework headers" ) -if (NOT IOS) - if (NOT LLDB_BUILT_STANDALONE) - add_dependencies(lldb-framework clang-headers) - endif() - add_custom_command(TARGET lldb-framework POST_BUILD - COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Headers ${LLDB_FRAMEWORK_DIR}/LLDB.framework/Headers - COMMAND ${CMAKE_COMMAND} -E create_symlink ${LLDB_FRAMEWORK_VERSION} ${LLDB_FRAMEWORK_DIR}/LLDB.framework/Versions/Current - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/clang/${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH} $/Resources/Clang - ) -endif() +# Also collect vendor-specific headers from clang and copy them into a +# staging directory. Later we can copy over the entire folder. +if(NOT IOS AND NOT LLDB_BUILT_STANDALONE) + get_target_property(clang_include_dir clang-headers RUNTIME_OUTPUT_DIRECTORY) + file(GLOB_RECURSE clang_vendor_headers RELATIVE ${clang_include_dir} "${clang_include_dir}/*") -add_dependencies(lldb-framework - lldb-framework-headers - lldb-suite) + set(clang_header_staging ${CMAKE_CURRENT_BINARY_DIR}/ClangHeaders) + foreach(header ${clang_vendor_headers}) + set(source_header ${clang_include_dir}/${header}) + set(staged_header ${clang_header_staging}/${header}) -add_custom_target(install-lldb-framework) -add_custom_target(install-lldb-framework-stripped) + add_custom_command( + DEPENDS ${source_header} OUTPUT ${staged_header} + COMMAND ${CMAKE_COMMAND} -E copy ${source_header} ${staged_header} + COMMENT "LLDB.framework: collect clang vendor-specific headers") + + list(APPEND clang_staged_headers ${staged_header}) + endforeach() + + # Wrap output in a target, so lldb-framework can depend on it. + add_custom_target(lldb-framework-clang-headers DEPENDS ${clang_staged_headers}) + add_dependencies(lldb-framework-clang-headers clang-headers) + + # At build time, copy the staged headers into the framework bundle. + add_custom_command(TARGET lldb-framework-clang-headers POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory + ${clang_header_staging} $/Resources/Clang/include + ) + + # liblldb creates the binary. + # lldb-framework adds extra steps for a fully functional framework bundle. + add_dependencies(lldb-framework + liblldb + lldb-framework-headers + lldb-framework-clang-headers + ) +endif() Index: resources/LLDB-Info.plist.in =================================================================== --- /dev/null +++ resources/LLDB-Info.plist.in @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + LLDB + CFBundleIdentifier + ${MACOSX_FRAMEWORK_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + FMWK + CFBundleShortVersionString + ${MACOSX_FRAMEWORK_SHORT_VERSION_STRING} + CFBundleSignature + ???? + CFBundleVersion + ${MACOSX_FRAMEWORK_BUNDLE_VERSION} + CFBundleName + LLDB + + Index: source/API/CMakeLists.txt =================================================================== --- source/API/CMakeLists.txt +++ source/API/CMakeLists.txt @@ -92,24 +92,25 @@ Support ) -add_dependencies(lldb-suite liblldb) +if(LLDB_WRAP_PYTHON) + add_dependencies(liblldb swig_wrapper) -if (MSVC) - set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY COMPILE_FLAGS " /W0") -else() - set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY COMPILE_FLAGS " -w") -endif() + if (MSVC) + set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY COMPILE_FLAGS " /W0") + else() + set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY COMPILE_FLAGS " -w") + endif() -set_source_files_properties(${LLDB_WRAP_PYTHON} PROPERTIES GENERATED 1) -if (CLANG_CL) - set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING - PROPERTY COMPILE_FLAGS " -Wno-unused-function") + if (CLANG_CL) + set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING + PROPERTY COMPILE_FLAGS " -Wno-unused-function") + endif() + if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND + NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darwin") + set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING + PROPERTY COMPILE_FLAGS " -Wno-sequence-point -Wno-cast-qual") + endif () endif() -if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND - NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darwin") - set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING - PROPERTY COMPILE_FLAGS " -Wno-sequence-point -Wno-cast-qual") -endif () set_target_properties(liblldb PROPERTIES @@ -144,18 +145,6 @@ ) endif() -if (LLDB_BUILD_FRAMEWORK) - set_target_properties(liblldb - PROPERTIES - SOVERSION "1.0.0" - OUTPUT_NAME LLDB - FRAMEWORK On - FRAMEWORK_VERSION ${LLDB_FRAMEWORK_VERSION} - MACOSX_FRAMEWORK_INFO_PLIST ${LLDB_SOURCE_DIR}/resources/LLDB-Info.plist - LIBRARY_OUTPUT_DIRECTORY ${LLDB_FRAMEWORK_DIR} - ) -endif() - -if (LLDB_WRAP_PYTHON) - add_dependencies(liblldb swig_wrapper) +if(LLDB_BUILD_FRAMEWORK) + include(LLDBFramework) endif() Index: test/CMakeLists.txt =================================================================== --- test/CMakeLists.txt +++ test/CMakeLists.txt @@ -79,7 +79,13 @@ endif() if(LLDB_BUILD_FRAMEWORK) - list(APPEND LLDB_TEST_COMMON_ARGS --framework ${LLDB_FRAMEWORK_DIR}/LLDB.framework) + # The $ generator expression + # provides this value, but LLDB_DOTEST_ARGS needs it at configuration-time. + get_filename_component( + framework_target_dir ${LLDB_FRAMEWORK_BUILD_DIR} ABSOLUTE + BASE_DIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR} + ) + list(APPEND LLDB_TEST_COMMON_ARGS --framework ${framework_target_dir}/LLDB.framework) endif() if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows|Darwin") Index: tools/argdumper/CMakeLists.txt =================================================================== --- tools/argdumper/CMakeLists.txt +++ tools/argdumper/CMakeLists.txt @@ -1,4 +1,4 @@ -add_lldb_tool(lldb-argdumper INCLUDE_IN_SUITE +add_lldb_tool(lldb-argdumper argdumper.cpp LINK_LIBS Index: tools/darwin-debug/CMakeLists.txt =================================================================== --- tools/darwin-debug/CMakeLists.txt +++ tools/darwin-debug/CMakeLists.txt @@ -1,3 +1,3 @@ -add_lldb_tool(darwin-debug INCLUDE_IN_SUITE +add_lldb_tool(darwin-debug darwin-debug.cpp ) Index: tools/debugserver/CMakeLists.txt =================================================================== --- tools/debugserver/CMakeLists.txt +++ tools/debugserver/CMakeLists.txt @@ -15,11 +15,6 @@ set(LLDB_SOURCE_DIR "${CMAKE_SOURCE_DIR}/../../") include_directories(${LLDB_SOURCE_DIR}/include) - - # 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) endif() add_subdirectory(source) Index: tools/debugserver/source/CMakeLists.txt =================================================================== --- tools/debugserver/source/CMakeLists.txt +++ tools/debugserver/source/CMakeLists.txt @@ -240,7 +240,7 @@ COMPILE_DEFINITIONS HAVE_LIBCOMPRESSION) endif() set(LLVM_OPTIONAL_SOURCES ${lldbDebugserverCommonSources}) - add_lldb_tool(debugserver INCLUDE_IN_SUITE + add_lldb_tool(debugserver debugserver.cpp LINK_LIBS Index: tools/driver/CMakeLists.txt =================================================================== --- tools/driver/CMakeLists.txt +++ tools/driver/CMakeLists.txt @@ -19,7 +19,6 @@ endif() add_dependencies(lldb - ${LLDB_SUITE_TARGET} LLDBOptionsTableGen ${tablegen_deps} ) Index: tools/lldb-server/CMakeLists.txt =================================================================== --- tools/lldb-server/CMakeLists.txt +++ tools/lldb-server/CMakeLists.txt @@ -42,7 +42,7 @@ list(APPEND LLDB_PLUGINS lldbPluginObjectFileELF) endif() -add_lldb_tool(lldb-server INCLUDE_IN_SUITE +add_lldb_tool(lldb-server Acceptor.cpp lldb-gdbserver.cpp lldb-platform.cpp