[PATCH] D51567: CMake: Consolidate gtest detection code

2019-11-14 Thread Tom Stellard via Phabricator via cfe-commits
tstellar abandoned this revision.
tstellar added a comment.
Herald added a project: clang.

Dropping this since it is more Fedora specific.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D51567/new/

https://reviews.llvm.org/D51567



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D51567: CMake: Consolidate gtest detection code

2018-09-04 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In https://reviews.llvm.org/D51567#1222704, @chandlerc wrote:

> I mean, sure.
>
> I really don't know that supporting this ever expanding diversity of build 
> strategies is worth its cost, but I don't see a specific reason to not take 
> this patch


I actually agree with you that we don't want to be supporting every possible 
strategy in trunk.  I usually try to keep Fedora specific stuff like this out 
of trunk, but in this case it looked like a useful code simplification that 
might be generally helpful.


Repository:
  rC Clang

https://reviews.llvm.org/D51567



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D51567: CMake: Consolidate gtest detection code

2018-09-04 Thread Chandler Carruth via Phabricator via cfe-commits
chandlerc accepted this revision.
chandlerc added a comment.
This revision is now accepted and ready to land.

I mean, sure.

I really don't know that supporting this ever expanding diversity of build 
strategies is worth its cost, but I don't see a specific reason to not take 
this patch


Repository:
  rC Clang

https://reviews.llvm.org/D51567



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D51567: CMake: Consolidate gtest detection code

2018-08-31 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.
tstellar added reviewers: chandlerc, beanz.
Herald added a subscriber: mgorny.

This makes it possible to build the unittests with only the gtest sources
and without a full LLVM source tree.


Repository:
  rC Clang

https://reviews.llvm.org/D51567

Files:
  CMakeLists.txt


Index: CMakeLists.txt
===
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -142,12 +142,6 @@
 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
@@ -486,12 +480,18 @@
 
 
 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)
 add_subdirectory(unittests)
 list(APPEND CLANG_TEST_DEPS ClangUnitTests)
 list(APPEND CLANG_TEST_PARAMS
   clang_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/test/Unit/lit.site.cfg
   )
+if (CLANG_BUILT_STANDALONE
+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()
   endif()
   add_subdirectory(test)
 


Index: CMakeLists.txt
===
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -142,12 +142,6 @@
 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
@@ -486,12 +480,18 @@
 
 
 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)
 add_subdirectory(unittests)
 list(APPEND CLANG_TEST_DEPS ClangUnitTests)
 list(APPEND CLANG_TEST_PARAMS
   clang_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/test/Unit/lit.site.cfg
   )
+if (CLANG_BUILT_STANDALONE
+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()
   endif()
   add_subdirectory(test)
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits