[Lldb-commits] [PATCH] D25570: [CMake] Populate LLDB.framework's headers directory
Chris Bieneman via lldb-commits
lldb-commits at lists.llvm.org
Thu Oct 13 10:34:47 PDT 2016
beanz created this revision.
beanz added reviewers: tfiala, zturner, spyffe.
beanz added a subscriber: lldb-commits.
Herald added a subscriber: mgorny.
This patch adds support for installing public headers in LLDB.framework, and symlinking the headers into the build directory.
While writing the patch I discovered a bug in CMake that prevents applying POST_BUILD steps to framework targets (https://gitlab.kitware.com/cmake/cmake/issues/16363).
I've implemented the support using POST_BUILD steps wrapped under a CMake version check with a TODO so that we can track the fix.
https://reviews.llvm.org/D25570
Files:
source/API/CMakeLists.txt
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 $<TARGET_FILE_DIR:liblldb>/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 $<TARGET_FILE_DIR:liblldb>/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()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25570.74543.patch
Type: text/x-patch
Size: 1647 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20161013/c2b14b31/attachment.bin>
More information about the lldb-commits
mailing list