[PATCH] D145946: [third-party] Respect LLVM_INSTALL_GTEST for llvm_gtest_main

Michał Górny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 13 08:40:11 PDT 2023


mgorny created this revision.
mgorny added a reviewer: tstellar.
Herald added a project: All.
mgorny requested review of this revision.

Pass BUILDTREE_ONLY to llvm_gtest_main only if LLVM_INSTALL_GTEST
is not set.  This fixes 0807986303f5d498cee32d42c242940d00617ad9 <https://reviews.llvm.org/rG0807986303f5d498cee32d42c242940d00617ad9>.
Otherwise, llvm_gtest_main cannot be used
in LLVM_DISTRIBUTION_COMPONENTS, effectively making it impossible
to install llvm_gtest correctly.


https://reviews.llvm.org/D145946

Files:
  third-party/unittest/UnitTestMain/CMakeLists.txt


Index: third-party/unittest/UnitTestMain/CMakeLists.txt
===================================================================
--- third-party/unittest/UnitTestMain/CMakeLists.txt
+++ third-party/unittest/UnitTestMain/CMakeLists.txt
@@ -1,3 +1,8 @@
+set(BUILDTREE_ONLY BUILDTREE_ONLY)
+if (LLVM_INSTALL_GTEST)
+  set(BUILDTREE_ONLY "")
+endif ()
+
 add_llvm_library(llvm_gtest_main
   TestMain.cpp
 
@@ -7,6 +12,5 @@
   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}
   )


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145946.504677.patch
Type: text/x-patch
Size: 591 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230313/c0093bda/attachment.bin>


More information about the llvm-commits mailing list