Don't use the unofficial libevent component#1837
Merged
tatsuhiro-t merged 1 commit intonghttp2:masterfrom Dec 23, 2022
Merged
Conversation
Member
|
Thank you for PR. Merged now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The official libevent cmake file, does not declare the libevent component, which is a combination of
coreandextra, see https://github.com/libevent/libevent/blob/master/cmake/LibeventConfig.cmake.in, so it should not be used here, even if the embeddedFindLibevent.cmakesupports it.This causes problems for me in combination with the Conan package manager, which sets
CMAKE_FIND_PACKAGE_PREFER_CONFIGto true, which makesfind_packageuse the system version instead of the embedded version, and therefore fails to find thelibeventcomponent. See this discussion and other linked issues for more information about that conan-io/conan#12488This is a problem only if the configuration is set to not need libevent, since
find_packageis called unconditionally. When libevent is actually needed, the Conan version will be used instead, which does not cause any problems.The fix is simple, just request
coreandextrainstead oflibevent. I did not make any changes toFindLibevent.cmake, since this change works with the version in this repository without any changes. But I do believe that in the long run it would be better to replace it with something much closer to the officialLibeventConfig.cmake.