Pass BUILDTREE_ONLY to llvm_gtest_main only if LLVM_INSTALL_GTEST
is not set. This fixes
0807986303f5d498cee32d42c242940d00617ad9.
Otherwise, llvm_gtest_main cannot be used
in LLVM_DISTRIBUTION_COMPONENTS, effectively making it impossible
to install llvm_gtest correctly.
Differential Revision: https://reviews.llvm.org/D145946
+set(BUILDTREE_ONLY BUILDTREE_ONLY)
+if (LLVM_INSTALL_GTEST)
+ set(BUILDTREE_ONLY "")
+endif ()
+
add_llvm_library(llvm_gtest_main
TestMain.cpp
LINK_COMPONENTS
Support # Depends on llvm::cl
- # This library is not meant to be in the install tree, only the build tree.
- BUILDTREE_ONLY
+ ${BUILDTREE_ONLY}
)