cmake: replace check_library_exists_concat()
#12070
Closed
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 idea of
check_library_exists_concat()
is that it detects anoptional component and adds it to the list of libs that we also use in
subsequent component checks. This caused problems when detecting
components with unnecessary dependencies that were not yet built.
CMake offers the
CMAKE_REQUIRED_LIBRARIES
variable to set libs usedfor component checks, which we already use in most cases. That left 4
uses of
check_library_exists_concat()
. Only one of these actuallyneeded the 'concat' feature (ldap/lber).
Delete this function and replace it with standard
check_library_exists()
and manual management of ourCURL_LIBS
list we use when linking build targets. And special logic to handle the
ldap/lber case.
(We have a similar function for headers:
check_include_file_concat()
.It works, but problematic for performance reasons and because it hides
the actual headers required in
check_symbol_exists()
calls.)Ref: #11537 #11558
Fixes #11285
Fixes #11648
Closes #12070