[Mlir-commits] [mlir] 6b471b3 - [mlir] [test] Fix unittests in standalone builds (#120910)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Dec 24 23:12:50 PST 2024
Author: Michał Górny
Date: 2024-12-25T07:12:47Z
New Revision: 6b471b30d7dbce589af16b39f9eb960195a8cd02
URL: https://github.com/llvm/llvm-project/commit/6b471b30d7dbce589af16b39f9eb960195a8cd02
DIFF: https://github.com/llvm/llvm-project/commit/6b471b30d7dbce589af16b39f9eb960195a8cd02.diff
LOG: [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).
Added:
Modified:
mlir/CMakeLists.txt
Removed:
################################################################################
diff --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
index 99ea1b70fbc4d2..5ea49c0dbfa7e3 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")
More information about the Mlir-commits
mailing list