[Mlir-commits] [mlir] c95c0db - [MLIR] Fix building unittests in in-tree build

Mehdi Amini llvmlistbot at llvm.org
Wed Feb 3 17:59:28 PST 2021


Author: Isuru Fernando
Date: 2021-02-04T01:59:12Z
New Revision: c95c0db2eb687edb91afa628655bb5025f7e863b

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

LOG: [MLIR] Fix building unittests in in-tree build

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D95978

Added: 
    

Modified: 
    mlir/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
index baacbdd33b3a..5d21312bccc3 100644
--- a/mlir/CMakeLists.txt
+++ b/mlir/CMakeLists.txt
@@ -133,7 +133,7 @@ add_subdirectory(lib)
 add_subdirectory(lib/CAPI)
 if (MLIR_INCLUDE_TESTS)
   add_definitions(-DMLIR_INCLUDE_TESTS)
-  if (TARGET gtest)
+  if (EXISTS ${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include/gtest/gtest.h)
     add_subdirectory(unittests)
   else()
     message(WARNING "gtest not found, unittests will not be available")


        


More information about the Mlir-commits mailing list