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

gtest/avif_fuzztest_helpers.cc is compiled once for each fuzztest target #2358

Closed
wantehchang opened this issue Aug 1, 2024 · 2 comments
Closed
Assignees

Comments

@wantehchang
Copy link
Collaborator

In tests/CMakeLists.txt, the add_avif_fuzztest macro is defned as follows:

    macro(add_avif_fuzztest TEST_NAME)
        add_executable(${TEST_NAME} gtest/${TEST_NAME}.cc gtest/avif_fuzztest_helpers.cc ${ARGN})
        ...

I think this means gtest/avif_fuzztest_helpers.cc is compiled once for each fuzztest target. We should move it to an object or static library so that it is compiled only once for all fuzztest targets.

@vrabaud
Copy link
Collaborator

vrabaud commented Aug 29, 2024

I had not done so because this requires calling link_fuzztest on the object library and that function is totally opaque (e.g. it might just work on a binary). Luckily, all it does is calling target_link_libraries, cf https://github.com/google/fuzztest/blob/02daa2ab69f514109c8831d72a13ffab49f6f375/cmake/AddFuzzTest.cmake#L1

Feel free to approve #2417 to get a solution that works until link_fuzztest does not change behavior.

@vrabaud
Copy link
Collaborator

vrabaud commented Aug 30, 2024

Fixed by #2417

@vrabaud vrabaud closed this as completed Aug 30, 2024
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

No branches or pull requests

2 participants