From fba210822e8824f0e41c5b70cd3c09f1826ff721 Mon Sep 17 00:00:00 2001 From: Michael Gottesman Date: Thu, 21 Jul 2016 21:35:23 +0000 Subject: [PATCH] [cmake] Move the including of utils/unittests under LLVM_INCLUDE_UTILS instead of LLVM_INCLUDE_TESTS. This does not change anything by default since LLVM_INCLUDE_UTILS is already set to TRUE by default. In addition, since LLVM_INCLUDE_TESTS => LLVM_INCLUDE_UTILS, the only way that this can cause changes is in the case where LLVM_INCLUDE_UTILS is set to TRUE, but LLVM_INCLUDE_TESTS is FALSE. In that case, building gtest is not a huge cost. The reason to do this is that without this change, one can not turn off LLVM_INCLUDE_TESTS in downstream projects that also use gtest for unittests. It also just in general makes more sense since LLVM_INCLUDE_UTILS gates FileCheck and other utilities that are along the lines of gtest. Additionally from talking with chandlerc, this was not done for any specific reason, so there is no reason not to do it and lots of benefit to doing it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276342 91177308-0d34-0410-b5e6-96231b3b80d8 (cherry picked from commit f517b9f699e1940f32ef8fee9a4499b13ab1b282) --- CMakeLists.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a7f58430dd0..112838f82d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -656,6 +656,7 @@ if( LLVM_INCLUDE_UTILS ) add_subdirectory(utils/not) add_subdirectory(utils/llvm-lit) add_subdirectory(utils/yaml-bench) + add_subdirectory(utils/unittest) else() if ( LLVM_INCLUDE_TESTS ) message(FATAL_ERROR "Including tests when not building utils will not work. @@ -663,10 +664,6 @@ else() endif() endif() -if(LLVM_INCLUDE_TESTS) - add_subdirectory(utils/unittest) -endif() - foreach( binding ${LLVM_BINDINGS_LIST} ) if( EXISTS "${LLVM_MAIN_SRC_DIR}/bindings/${binding}/CMakeLists.txt" ) add_subdirectory(bindings/${binding})