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.
This commit is contained in:
Mehdi Amini 2021-02-11 01:17:24 +00:00
parent fa35c1f80f
commit 09cfec6243
3 changed files with 2 additions and 4 deletions

View File

@ -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()

View File

@ -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

View File

@ -1,4 +1,3 @@
add_custom_target(MLIRUnitTests)
set_target_properties(MLIRUnitTests PROPERTIES FOLDER "MLIR Tests")
function(add_mlir_unittest test_dirname)