diff options
| author | Reid Kleckner <reid@kleckner.net> | 2014-11-05 23:51:45 +0000 |
|---|---|---|
| committer | Reid Kleckner <reid@kleckner.net> | 2014-11-05 23:51:45 +0000 |
| commit | 7bfd8bccb51a268b4123f71905f36521f0b4d123 (patch) | |
| tree | 34bfadcb7c793a4480c4ba6c3045a5b57946934f | |
| parent | 80118548d26135a102ccb5ee37e86eee9d3ef10d (diff) | |
| download | bcm5719-llvm-7bfd8bccb51a268b4123f71905f36521f0b4d123.tar.gz bcm5719-llvm-7bfd8bccb51a268b4123f71905f36521f0b4d123.zip | |
cmake: Only export targets in the standalone build
Trying to fix bots that didn't like the fact that I exported targets
that depended on LLVM without exporting targets from LLVM.
llvm-svn: 221415
| -rw-r--r-- | clang/CMakeLists.txt | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt index ba3db6c141e..fbff5add480 100644 --- a/clang/CMakeLists.txt +++ b/clang/CMakeLists.txt @@ -480,24 +480,26 @@ endif() set(CLANG_ORDER_FILE "" CACHE FILEPATH "Order file to use when compiling clang in order to improve startup time.") -# Generate a list of CMake library targets so that other CMake projects can -# link against them. LLVM calls its version of this file LLVMExports.cmake, but -# the usual CMake convention seems to be ${Project}Targets.cmake. -set(CLANG_INSTALL_PACKAGE_DIR share/clang/cmake) -set(clang_cmake_builddir "${CMAKE_BINARY_DIR}/${CLANG_INSTALL_PACKAGE_DIR}") -get_property(CLANG_EXPORTS GLOBAL PROPERTY CLANG_EXPORTS) -export(TARGETS ${CLANG_EXPORTS} FILE ${clang_cmake_builddir}/ClangTargets.cmake) - -# Install a <prefix>/share/clang/cmake/ClangConfig.cmake file so that -# find_package(Clang) works. Install the target list with it. -install(FILES - ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/ClangConfig.cmake - ${CLANG_BINARY_DIR}/share/clang/cmake/ClangTargets.cmake - DESTINATION share/clang/cmake) - -# Also copy ClangConfig.cmake to the build directory so that dependent projects -# can build against a build directory of Clang more easily. -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/ClangConfig.cmake - ${CLANG_BINARY_DIR}/share/clang/cmake/ClangConfig.cmake - COPYONLY) +if (CLANG_BUILT_STANDALONE) + # Generate a list of CMake library targets so that other CMake projects can + # link against them. LLVM calls its version of this file LLVMExports.cmake, but + # the usual CMake convention seems to be ${Project}Targets.cmake. + set(CLANG_INSTALL_PACKAGE_DIR share/clang/cmake) + set(clang_cmake_builddir "${CMAKE_BINARY_DIR}/${CLANG_INSTALL_PACKAGE_DIR}") + get_property(CLANG_EXPORTS GLOBAL PROPERTY CLANG_EXPORTS) + export(TARGETS ${CLANG_EXPORTS} FILE ${clang_cmake_builddir}/ClangTargets.cmake) + + # Install a <prefix>/share/clang/cmake/ClangConfig.cmake file so that + # find_package(Clang) works. Install the target list with it. + install(FILES + ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/ClangConfig.cmake + ${CLANG_BINARY_DIR}/share/clang/cmake/ClangTargets.cmake + DESTINATION share/clang/cmake) + + # Also copy ClangConfig.cmake to the build directory so that dependent projects + # can build against a build directory of Clang more easily. + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/ClangConfig.cmake + ${CLANG_BINARY_DIR}/share/clang/cmake/ClangConfig.cmake + COPYONLY) +endif () |

