[llvm-branch-commits] [clang] 911756e - [PATCH] Reorganize gtest integration

Nikita Popov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue May 3 01:15:43 PDT 2022


Author: serge-sans-paille
Date: 2022-05-03T10:05:27+02:00
New Revision: 911756e62f00720c3403b62054d815a8ac4dd308

URL: https://github.com/llvm/llvm-project/commit/911756e62f00720c3403b62054d815a8ac4dd308
DIFF: https://github.com/llvm/llvm-project/commit/911756e62f00720c3403b62054d815a8ac4dd308.diff

LOG: [PATCH] Reorganize gtest integration

Added: 
    

Modified: 
    clang/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index 594e6d0887429..7d8a2d0a9fceb 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -159,12 +159,6 @@ if(CLANG_BUILT_STANDALONE)
         set(LLVM_UTILS_PROVIDED ON)
         set(CLANG_TEST_DEPS FileCheck count not)
       endif()
-      set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest)
-      if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h
-          AND NOT EXISTS ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
-          AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
-        add_subdirectory(${UNITTEST_DIR} utils/unittest)
-      endif()
     else()
       # Seek installed Lit.
       find_program(LLVM_LIT
@@ -574,7 +568,11 @@ endif()
 
 
 if( CLANG_INCLUDE_TESTS )
-  if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include/gtest/gtest.h)
+  set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest)
+  if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h
+      AND NOT EXISTS ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
+      AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
+    add_subdirectory(${UNITTEST_DIR} utils/unittest)
     add_subdirectory(unittests)
     list(APPEND CLANG_TEST_DEPS ClangUnitTests)
     list(APPEND CLANG_TEST_PARAMS


        


More information about the llvm-branch-commits mailing list