[Mlir-commits] [mlir] 09cfec6 - Fix CMake configuration for MLIR unittests
Mehdi Amini
llvmlistbot at llvm.org
Wed Feb 10 17:18:53 PST 2021
Author: Mehdi Amini
Date: 2021-02-11T01:17:49Z
New Revision: 09cfec62432993abde7829a88ce4793d8805ce4b
URL: https://github.com/llvm/llvm-project/commit/09cfec62432993abde7829a88ce4793d8805ce4b
DIFF: https://github.com/llvm/llvm-project/commit/09cfec62432993abde7829a88ce4793d8805ce4b.diff
LOG: Fix CMake configuration for MLIR unittests
The CMake changes in 2aa1af9b1da to make it possible to build MLIR as a
standalone project unfortunately disabled all unit-tests from the
regular in-tree build.
Added:
Modified:
mlir/CMakeLists.txt
mlir/test/CMakeLists.txt
mlir/unittests/CMakeLists.txt
Removed:
################################################################################
diff --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
index 91ad37f77f52..dc0375605326 100644
--- a/mlir/CMakeLists.txt
+++ b/mlir/CMakeLists.txt
@@ -133,6 +133,7 @@ add_subdirectory(lib)
add_subdirectory(lib/CAPI)
if (MLIR_INCLUDE_TESTS)
add_definitions(-DMLIR_INCLUDE_TESTS)
+ add_custom_target(MLIRUnitTests)
if (EXISTS ${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include/gtest/gtest.h)
add_subdirectory(unittests)
else()
diff --git a/mlir/test/CMakeLists.txt b/mlir/test/CMakeLists.txt
index 999201e41551..9a45b297b474 100644
--- a/mlir/test/CMakeLists.txt
+++ b/mlir/test/CMakeLists.txt
@@ -57,9 +57,7 @@ set(MLIR_TEST_DEPENDS
mlir_async_runtime
)
-if(TARGET gtest)
- list(APPEND MLIR_TEST_DEPENDS MLIRUnitTests)
-endif()
+list(APPEND MLIR_TEST_DEPENDS MLIRUnitTests)
if(LLVM_BUILD_EXAMPLES)
list(APPEND MLIR_TEST_DEPENDS
diff --git a/mlir/unittests/CMakeLists.txt b/mlir/unittests/CMakeLists.txt
index d8d52fc1fd53..0e086ff5d328 100644
--- a/mlir/unittests/CMakeLists.txt
+++ b/mlir/unittests/CMakeLists.txt
@@ -1,4 +1,3 @@
-add_custom_target(MLIRUnitTests)
set_target_properties(MLIRUnitTests PROPERTIES FOLDER "MLIR Tests")
function(add_mlir_unittest test_dirname)
More information about the Mlir-commits
mailing list