message(FATAL_ERROR "LLDB.framework can only be generated when targeting Apple platforms")
endif()
+ 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(LLDB_FRAMEWORK_DIR
${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_FRAMEWORK_INSTALL_DIR})
+ include(LLDBFramework)
endif()
add_subdirectory(docs)
add_subdirectory(utils/lldb-dotest)
endif()
-if (LLDB_BUILD_FRAMEWORK)
- add_custom_target(lldb-framework)
- include(LLDBFramework)
-endif()
if (NOT LLDB_DISABLE_PYTHON)
# Add a Post-Build Event to copy over Python files and create the symlink
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)
endif()
install(TARGETS ${name}
COMPONENT ${name}
endif()
if (NOT CMAKE_CONFIGURATION_TYPES)
add_llvm_install_targets(install-${name}
- DEPENDS ${name}
+ DEPENDS $<TARGET_FILE:${name}>
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-lldb-framework-stripped lldb-framework)
+ endif()
endif()
endif()
endif()
+
# Hack: only some LLDB libraries depend on the clang autogenerated headers,
# but it is simple enough to make all of LLDB depend on some of those
# headers without negatively impacting much of anything.
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}
)
endif()
-set_target_properties(liblldb PROPERTIES
- OUTPUT_NAME LLDB
- FRAMEWORK On
- FRAMEWORK_VERSION ${LLDB_FRAMEWORK_VERSION}
- MACOSX_FRAMEWORK_INFO_PLIST ${LLDB_SOURCE_DIR}/resources/LLDB-Info.plist
- LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}
- PUBLIC_HEADER "${framework_headers}")
-
add_dependencies(lldb-framework
lldb-framework-headers
lldb-suite)
+
+add_custom_target(install-lldb-framework)
+add_custom_target(install-lldb-framework-stripped)
)
endif()
+if (LLDB_BUILD_FRAMEWORK)
+ set_target_properties(liblldb
+ PROPERTIES
+ 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)
endif()