-
Notifications
You must be signed in to change notification settings - Fork 456
CDRIVER-4637 Remove ENABLE_SRV=AUTO, clean up SRV URI support #1301
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
vector-of-bool
merged 13 commits into
mongodb:master
from
vector-of-bool:CDRIVER-4637-ENABLE_SRV
Jun 26, 2023
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
a84fa5a
Remove AUTO for ENABLE_SRV
vector-of-bool 6abe0f1
Use ENABLE_SRV to toggle SRV support rather than detection macros
vector-of-bool 18146ac
Add distinct feature flag for SRV toggle.
vector-of-bool ea2ef8a
Refactor pkg-config generation to use target properties
vector-of-bool 2c37650
Tweak method of detecting name resolution
vector-of-bool 9e42bfc
Rename intermediate interface libs
vector-of-bool 5ea027b
Swap resolv search order for with/without a link
vector-of-bool db385dc
Sppeling
vector-of-bool db2d403
Spelling and tpyos
vector-of-bool bb3d49d
Another one
vector-of-bool 416e5f9
PR cleanup and feedback
vector-of-bool 52b881e
Regex tweak
vector-of-bool d997d82
Tweak .pc generation
vector-of-bool File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
include(CheckSymbolExists) | ||
include(CMakePushCheckState) | ||
|
||
cmake_push_check_state(RESET) | ||
|
||
# The name of the library that performs name resolution, suitable for giving to the "-l" link flag | ||
set(RESOLVE_LIB_NAME) | ||
# If TRUE, then the C runtime provides the name resolution that we need | ||
set(resolve_is_libc FALSE) | ||
|
||
if(WIN32) | ||
set(RESOLVE_LIB_NAME Dnsapi) | ||
set(_MONGOC_HAVE_DNSAPI 1) | ||
else() | ||
# Try to find the search functions for various configurations. | ||
# Headers required by minimum on the strictest system: (Tested on FreeBSD 13) | ||
set(resolve_headers netinet/in.h sys/types.h arpa/nameser.h resolv.h) | ||
set(CMAKE_REQUIRED_LIBRARIES resolv) | ||
check_symbol_exists(res_nsearch "${resolve_headers}" _MONGOC_HAVE_RES_NSEARCH_RESOLV) | ||
check_symbol_exists(res_search "${resolve_headers}" _MONGOC_HAVE_RES_SEARCH_RESOLV) | ||
check_symbol_exists(res_ndestroy "${resolve_headers}" _MONGOC_HAVE_RES_NDESTROY_RESOLV) | ||
check_symbol_exists(res_nclose "${resolve_headers}" _MONGOC_HAVE_RES_NCLOSE_RESOLV) | ||
if((_MONGOC_HAVE_RES_NSEARCH_RESOLV OR _MONGOC_HAVE_RES_SEARCH_RESOLV) | ||
AND (_MONGOC_HAVE_RES_NDESTROY_RESOLV OR _MONGOC_HAVE_RES_NCLOSE_RESOLV)) | ||
set(RESOLVE_LIB_NAME resolv) | ||
else() | ||
# Can we use name resolution with just libc? | ||
unset(CMAKE_REQUIRED_LIBRARIES) | ||
check_symbol_exists(res_nsearch "${resolve_headers}" _MONGOC_HAVE_RES_NSEARCH_NOLINK) | ||
check_symbol_exists(res_search "${resolve_headers}" _MONGOC_HAVE_RES_SEARCH_NOLINK) | ||
check_symbol_exists(res_ndestroy "${resolve_headers}" _MONGOC_HAVE_RES_NDESTROY_NOLINK) | ||
check_symbol_exists(res_nclose "${resolve_headers}" _MONGOC_HAVE_RES_NCLOSE_NOLINK) | ||
if((_MONGOC_HAVE_RES_NSEARCH_NOLINK OR _MONGOC_HAVE_RES_SEARCH_NOLINK) | ||
AND (_MONGOC_HAVE_RES_NDESTROY_NOLINK OR _MONGOC_HAVE_RES_NCLOSE_NOLINK)) | ||
set(resolve_is_libc TRUE) | ||
message(VERBOSE "Name resolution is provided by the C runtime") | ||
endif() | ||
endif() | ||
endif() | ||
|
||
_mongo_pick(MONGOC_HAVE_DNSAPI 1 0 _MONGOC_HAVE_DNSAPI) | ||
_mongo_pick(MONGOC_HAVE_RES_NSEARCH 1 0 [[_MONGOC_HAVE_RES_NSEARCH_NOLINK OR _MONGOC_HAVE_RES_NSEARCH_RESOLV]]) | ||
_mongo_pick(MONGOC_HAVE_RES_SEARCH 1 0 [[_MONGOC_HAVE_RES_SEARCH_NOLINK OR _MONGOC_HAVE_RES_SEARCH_RESOLV]]) | ||
_mongo_pick(MONGOC_HAVE_RES_NDESTROY 1 0 [[_MONGOC_HAVE_RES_NDESTROY_NOLINK OR _MONGOC_HAVE_RES_NDESTROY_RESOLV]]) | ||
_mongo_pick(MONGOC_HAVE_RES_NCLOSE 1 0 [[_MONGOC_HAVE_RES_NCLOSE_NOLINK OR _MONGOC_HAVE_RES_NCLOSE_RESOLV]]) | ||
|
||
if(RESOLVE_LIB_NAME OR resolve_is_libc) | ||
# Define the resolver interface: | ||
add_library(_mongoc-resolve INTERFACE) | ||
add_library(mongo::detail::c_resolve ALIAS _mongoc-resolve) | ||
eramongodb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
set_target_properties(_mongoc-resolve PROPERTIES | ||
INTERFACE_LINK_LIBRARIES "${RESOLVE_LIB_NAME}" | ||
EXPORT_NAME detail::c_resolve) | ||
install(TARGETS _mongoc-resolve EXPORT mongoc-targets) | ||
endif() | ||
|
||
cmake_pop_check_state() |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.