Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mlir] [test] Fix unittests in standalone builds #120910

Merged
merged 1 commit into from
Dec 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[mlir] [test] Fix unittests in standalone builds
Fix the logic used to run unit tests to account for `llvm_gtest` targets
being installed, since 91b3ca3.  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).
  • Loading branch information
mgorny committed Dec 22, 2024
commit 91278789792679e197d8b739fac261ad931a4a96
7 changes: 1 addition & 6 deletions mlir/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -218,7 +213,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")
Expand Down
Loading