Index: source/API/CMakeLists.txt =================================================================== --- source/API/CMakeLists.txt +++ source/API/CMakeLists.txt @@ -135,10 +135,26 @@ target_link_libraries(liblldb PRIVATE ${LLDB_SYSTEM_LIBS}) if(LLDB_BUILD_FRAMEWORK) + file(GLOB public_headers ${LLDB_SOURCE_DIR}/include/lldb/API/*.h) set_target_properties(liblldb PROPERTIES OUTPUT_NAME LLDB FRAMEWORK On FRAMEWORK_VERSION ${LLDB_FRAMEWORK_VERSION} - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}) + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR} + PUBLIC_HEADER "${public_headers}") + + # Due to a bug in CMake (https://gitlab.kitware.com/cmake/cmake/issues/16363) + # we can't actually put a POST_BUILD step on Framework targets. + # TODO: Once the bug linked above is fixed we can update the version check to + # a valid CMake version. + if(CMAKE_VERSION VERSION_GREATER 99.9) + add_custom_command(TARGET liblldb POST_BUILD + COMMAND ${CMAKE_COMMAND} -E create_symlink ${LLDB_SOURCE_DIR}/include/lldb/API $/Headers) + else() + add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Versions/${LLDB_FRAMEWORK_VERSION}/Headers + COMMAND ${CMAKE_COMMAND} -E create_symlink ${LLDB_SOURCE_DIR}/include/lldb/API $/Headers) + add_custom_target(lldb_header_symlink + DEPENDS ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Versions/${LLDB_FRAMEWORK_VERSION}/Headers) + endif() endif()