Skip to content

Commit

Permalink
Fix CMake configuration for MLIR unittests
Browse files Browse the repository at this point in the history
The CMake changes in 2aa1af9 to make it possible to build MLIR as a
standalone project unfortunately disabled all unit-tests from the
regular in-tree build.
  • Loading branch information
joker-eph committed Feb 11, 2021
1 parent fa35c1f commit 09cfec6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions mlir/CMakeLists.txt
Expand Up @@ -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()
Expand Down
4 changes: 1 addition & 3 deletions mlir/test/CMakeLists.txt
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion 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)
Expand Down

0 comments on commit 09cfec6

Please sign in to comment.