fix: add support for S2N_INTERN_LIBCRYPTO
with FetchContent
#5076
+1
−1
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.
Release Summary:
Adds support for consuming s2n-tls from CMake FetchContent with interning enabled.
Resolved issues:
resolves #5075.
Description of changes:
lib/libs2n.a
doesn't exist in${CMAKE_CURRENT_BINARY_DIR}
with FetchContent. Sos2n-tls/CMakeLists.txt
Lines 446 to 452 in c6b41ef
/bin/ar: lib/libs2n.a: No such file or directory
.We can use
$<TARGET_FILE:${PROJECT_NAME}>
instead oflib/libs2n.a
to get the reallibs2n.a
path with/without FetchContent.Call-outs:
Is there code added that needs to be cleaned up later?
No.
Is there code that is missing because it’s still in development?
No.
Testing:
How is this change tested (unit tests, fuzz tests, etc.)?
We can use the reproducible steps in #5075. We can use this branch by the following
CMakeLists.txt
:What manual testing was performed?
cmake -S . -B build -GNinja ninja -C build lib/libs2n.a
They succeeded. See also the attached full logs:
Are there any testing steps to be verified by the reviewer?
The reviewer can use the same steps.
How can you convince your reviewers that this PR is safe and effective?
$<TARGET_FILE:XXX>
is a standard CMake feature and a portable way to get.a
file path. See also the CMake document: https://cmake.org/cmake/help/latest/manual/cmake-generator-expressions.7.html#genex:TARGET_FILEIs this a refactor change? If so, how have you proved that the intended behavior hasn't changed?
No.
Remember:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.