diff options
| author | Chris Bieneman <beanz@apple.com> | 2016-12-15 18:18:47 +0000 |
|---|---|---|
| committer | Chris Bieneman <beanz@apple.com> | 2016-12-15 18:18:47 +0000 |
| commit | 679d02f2a1859481363d4b22845040ec34b260a5 (patch) | |
| tree | 6587daa9614419bdafcd6ba3d9975ea6bea55842 | |
| parent | dc9b0db8e349e4b9a6344efa90f714280abbd493 (diff) | |
| download | bcm5719-llvm-679d02f2a1859481363d4b22845040ec34b260a5.tar.gz bcm5719-llvm-679d02f2a1859481363d4b22845040ec34b260a5.zip | |
[CMake] Only support LLDB_BUILD_FRAMEWORK on CMake 3.7 and later
CMake's framework target generation was unable to generate POST_BUILD steps (see: https://gitlab.kitware.com/cmake/cmake/issues/16363).
It turns out working around this is really not reasonable. The more reasonable solution to me is just to not support LLDB.framework unless you are on CMake 3.7 or newer.
Since CMake 3.7.1 is released that's how I'm going to handle this.
llvm-svn: 289841
| -rw-r--r-- | lldb/source/API/CMakeLists.txt | 25 | ||||
| -rw-r--r-- | lldb/test/CMakeLists.txt | 5 |
2 files changed, 8 insertions, 22 deletions
diff --git a/lldb/source/API/CMakeLists.txt b/lldb/source/API/CMakeLists.txt index b9e4fe92bc3..7e1e66bee3b 100644 --- a/lldb/source/API/CMakeLists.txt +++ b/lldb/source/API/CMakeLists.txt @@ -8,6 +8,10 @@ include(${LLDB_PROJECT_ROOT}/cmake/LLDBDependencies.cmake) option(LLDB_BUILD_FRAMEWORK "Build the Darwin LLDB.framework" Off) +if(LLDB_BUILD_FRAMEWORK AND CMAKE_VERSION VERSION_LESS 3.7) + message(FATAL_ERROR "LLDB_BUILD_FRAMEWORK is not supported on CMake < 3.7") +endif() + if (LLDB_BUILD_FRAMEWORK AND NOT APPLE) message(FATAL_ERROR "LLDB.framework cannot be generated unless targeting Apple platforms.") endif() @@ -140,24 +144,11 @@ if(LLDB_BUILD_FRAMEWORK) LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR} PUBLIC_HEADER "${public_headers}") - set(symlink_commands - COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_FILE_DIR:liblldb> - COMMAND ${CMAKE_COMMAND} -E create_symlink ${LLDB_SOURCE_DIR}/include/lldb/API $<TARGET_FILE_DIR:liblldb>/Headers + add_custom_command(TARGET liblldb POST_BUILD + COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_FILE_DIR:liblldb>/Versions/${LLDB_FRAMEWORK_VERSION} + COMMAND ${CMAKE_COMMAND} -E copy_directory ${LLDB_SOURCE_DIR}/include/lldb/API $<TARGET_FILE_DIR:liblldb>/Headers COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Headers ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Headers - COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/clang/${LLDB_VERSION} $<TARGET_FILE_DIR:liblldb>/Resources/Clang + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/clang/${LLDB_VERSION} $<TARGET_FILE_DIR:liblldb>/Resources/Clang ) - - # This works around a CMake bug where POST_BUILD steps are not applied to - # framework targets. This fix is merged into the CMake release branch and - # should be available with CMake 3.7 rc2: - # https://gitlab.kitware.com/cmake/cmake/issues/16363 - if(CMAKE_VERSION VERSION_GREATER 3.6.99) - add_custom_command(TARGET liblldb POST_BUILD ${symlink_commands}) - else() - add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Versions/${LLDB_FRAMEWORK_VERSION}/Headers - ${symlink_commands}) - 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() diff --git a/lldb/test/CMakeLists.txt b/lldb/test/CMakeLists.txt index 2da29c52d9d..2ff5a9ca051 100644 --- a/lldb/test/CMakeLists.txt +++ b/lldb/test/CMakeLists.txt @@ -27,11 +27,6 @@ if(TARGET lldb-mi) list(APPEND LLDB_TEST_DEPS lldb-mi) endif() -# This target will only exist if the user is using a CMake older than 3.7 -if(TARGET lldb_header_symlink) - list(APPEND LLDB_TEST_DEPS lldb_header_symlink) -endif() - if ("${LLDB_TEST_COMPILER}" STREQUAL "") string(REGEX REPLACE ".*ccache\ +" "" LLDB_TEST_COMPILER ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}) endif() |

