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

Remove AVIF_ENABLE_GTEST cmake option. #2527

Merged
merged 3 commits into from
Dec 20, 2024

Conversation

maryla-uc
Copy link
Collaborator

There is no need to have two AVIF_ENABLE_GTEST and AVIF_GTEST options.
Now setting AVIF_GTEST=LOCAL or AVIF_GTEST=SYSTEM automatically turns ont gtest tests.

@maryla-uc maryla-uc requested a review from vrabaud December 20, 2024 14:12
CMakeLists.txt Outdated
)
if(NOT AVIF_GTEST STREQUAL "OFF")
set(AVIF_ENABLE_GTEST ON)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to define an extra variable anymore: just replace the two instances of it below with AVIF_GTEST. Same in tests/CMakeLists.txt

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I though it was easier like this (and fewer changes) than checking NOT AVIF_GTEST STREQUAL "OFF" everywhere, no? Or does if(AVIF_GTEST) work? (I didn't think so since it's a string). I'm happy to change it though if you think it's better.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I thought it would work with "OFF", https://cmake.org/cmake/help/latest/command/if.html#constant but maybe you can try and see if it works. If not, if it is equal to "OFF", just set it to OFF

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That does seem to work. TIL!

@maryla-uc maryla-uc merged commit b808fa0 into AOMediaCodec:main Dec 20, 2024
34 checks passed
Copy link
Collaborator

@wantehchang wantehchang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good cleanup!

`AVIF_ENABLE_GTEST` CMake options. They require GoogleTest
(`-DAVIF_GTEST=SYSTEM` or `-DAVIF_GTEST=LOCAL`).
The remaining tests can be built by enabling `AVIF_BUILD_TESTS` and setting
`AVIF_GTEST` to `SYSTEM` or `LOCAL`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional: We can consider keeping the comment "They require GoogleTest."

if(AVIF_LIB_USE_CXX OR AVIF_BUILD_APPS OR (AVIF_BUILD_TESTS AND (AVIF_ENABLE_FUZZTEST
OR AVIF_ENABLE_GTEST))
)
if(AVIF_LIB_USE_CXX OR AVIF_BUILD_APPS OR (AVIF_BUILD_TESTS AND (AVIF_ENABLE_FUZZTEST OR AVIF_GTEST)))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think AVIF_ENABLE_FUZZTEST can receive the same treatment?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I'm working on it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, we talked about it but I wanted to add more stuff at the same time.
I fixed it in #2529 (and fuzztest is now downloadable from CMake just like any other dependency)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants