summaryrefslogtreecommitdiff
path: root/mlir/CMakeLists.txt
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2024-12-25 07:12:47 +0000
committerGitHub <noreply@github.com>2024-12-25 07:12:47 +0000
commit6b471b30d7dbce589af16b39f9eb960195a8cd02 (patch)
tree89c5341828ae255199c6b246a807db3053d32a5c /mlir/CMakeLists.txt
parente3846c0fecb5992110788be18cd04f70103bc778 (diff)
[mlir] [test] Fix unittests in standalone builds (#120910)
Fix the logic used to run unit tests to account for `llvm_gtest` targets being installed, since 91b3ca39667b6341a8c1983a1467fae14b58318b. This involves removing a rule that would cause a duplicate `llvm_gtest` target being created, and updates the method for determining whether unittests can be run to checking whether the target is present, rather than the source directory (that is no longer actually necessary).
Diffstat (limited to 'mlir/CMakeLists.txt')
-rw-r--r--mlir/CMakeLists.txt7
1 files changed, 1 insertions, 6 deletions
diff --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
index 99ea1b70fbc4..5ea49c0dbfa7 100644
--- a/mlir/CMakeLists.txt
+++ b/mlir/CMakeLists.txt
@@ -27,11 +27,6 @@ if(MLIR_STANDALONE_BUILD)
include_directories(${LLVM_INCLUDE_DIRS})
- set(UNITTEST_DIR ${LLVM_THIRD_PARTY_DIR}/unittest)
- if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h)
- add_subdirectory(${UNITTEST_DIR} third-party/unittest)
- endif()
-
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY
"${CMAKE_CURRENT_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
@@ -227,7 +222,7 @@ if (MLIR_INCLUDE_TESTS)
add_definitions(-DMLIR_INCLUDE_TESTS)
add_custom_target(MLIRUnitTests)
set_target_properties(MLIRUnitTests PROPERTIES FOLDER "MLIR/Tests")
- if (EXISTS ${LLVM_THIRD_PARTY_DIR}/unittest/googletest/include/gtest/gtest.h)
+ if (TARGET llvm_gtest)
add_subdirectory(unittests)
else()
message(WARNING "gtest not found, unittests will not be available")