Skip to content

[mlir] tentative fix for "'GTEST_NO_LLVM_SUPPORT' is not defined" war… #84539

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

Merged
merged 2 commits into from
Mar 8, 2024

Conversation

PeimingLiu
Copy link
Member

…ning when unittest is enabled

@PeimingLiu PeimingLiu marked this pull request as ready for review March 8, 2024 19:19
@llvmbot llvmbot added the mlir label Mar 8, 2024
@llvmbot
Copy link
Member

llvmbot commented Mar 8, 2024

@llvm/pr-subscribers-mlir

Author: Peiming Liu (PeimingLiu)

Changes

…ning when unittest is enabled


Full diff: https://github.com/llvm/llvm-project/pull/84539.diff

1 Files Affected:

  • (modified) mlir/CMakeLists.txt (+1)
diff --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
index 5c4301af040b47..9bc0ea1169f487 100644
--- a/mlir/CMakeLists.txt
+++ b/mlir/CMakeLists.txt
@@ -197,6 +197,7 @@ add_subdirectory(lib/CAPI)
 
 if (MLIR_INCLUDE_TESTS)
   add_definitions(-DMLIR_INCLUDE_TESTS)
+  add_definitions(-DGTEST_NO_LLVM_SUPPORT=0)
   add_custom_target(MLIRUnitTests)
   if (EXISTS ${LLVM_THIRD_PARTY_DIR}/unittest/googletest/include/gtest/gtest.h)
     add_subdirectory(unittests)

@ingomueller-net
Copy link
Contributor

I guess that this should silence the warnings for MLIR. I am not sure whether this shouldn't even be set at a higher level, maybe for all of LLVM. The question that I am not able to answer is what is the right default value? Some projects set the value to 1 and the whole purpose of the macro seems to be interoperability with LLVM. Doesn't this mean that the same value should be used for all of LLVM?

@PeimingLiu
Copy link
Member Author

PeimingLiu commented Mar 8, 2024

the question that I am not able to answer is what is the right default value?

Me either, I used 0 because it seems to be the default value used by (my local) compiler when the macro is not defined.

Doesn't this mean that the same value should be used for all of LLVM?

I am not sure about this either, the only subproject I can find which sets the value explicitly is

-DGTEST_NO_LLVM_SUPPORT=1
(and it uses value 1).

@PeimingLiu PeimingLiu requested a review from joker-eph March 8, 2024 21:08
@PeimingLiu PeimingLiu merged commit 3ceebcb into llvm:main Mar 8, 2024
@PeimingLiu PeimingLiu deleted the merger-batch branch March 11, 2024 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants