-
Notifications
You must be signed in to change notification settings - Fork 20
Link OpenSSL and ZLIB for C and C++ #147
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
Conversation
…and C++ starter templates
WalkthroughThe changes update CMake build configurations across multiple C and C++ project templates and solutions to require and link against the OpenSSL and Zlib libraries. Instead of manually specifying linker flags, the build scripts now use CMake's Changes
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (8)
solutions/c/01-gg4/code/CMakeLists.txt (2)
9-10
: Consistentfind_package
usage.
Duplicate of the comment incompiled_starters/c/CMakeLists.txt
regarding explicit dependency discovery.
14-15
: Consistent library linking.
Duplicate of the suggestion incompiled_starters/c/CMakeLists.txt
to merge the twotarget_link_libraries
calls.compiled_starters/cpp/CMakeLists.txt (2)
9-10
: Consistentfind_package
usage.
Duplicate of the comment incompiled_starters/c/CMakeLists.txt
regarding explicit dependency discovery.
14-15
: Consistent library linking.
Duplicate of the suggestion incompiled_starters/c/CMakeLists.txt
to merge the twotarget_link_libraries
calls.solutions/cpp/01-gg4/code/CMakeLists.txt (2)
9-10
: Consistentfind_package
usage.
Duplicate of the comment incompiled_starters/c/CMakeLists.txt
regarding explicit dependency discovery.
14-15
: Consistent library linking.
Duplicate of the suggestion incompiled_starters/c/CMakeLists.txt
to merge the twotarget_link_libraries
calls.starter_templates/c/code/CMakeLists.txt (2)
9-10
: Consistentfind_package
usage.
Duplicate of the comment incompiled_starters/c/CMakeLists.txt
regarding explicit dependency discovery.
14-15
: Consistent library linking.
Duplicate of the suggestion incompiled_starters/c/CMakeLists.txt
to merge the twotarget_link_libraries
calls.
🧹 Nitpick comments (4)
compiled_starters/c/CMakeLists.txt (2)
9-10
: Add explicit dependency checks with CMake’sfind_package
.
Lines 9–10 correctly locate OpenSSL and Zlib as REQUIRED packages, replacing manual linker flags and improving portability across platforms. Consider specifying a minimum version if your project relies on features introduced in specific releases (e.g.,find_package(OpenSSL 3.0 REQUIRED)
orfind_package(ZLIB 1.2.11 REQUIRED)
).
14-15
: Consolidatetarget_link_libraries
calls for clarity.
You can reduce duplication by combining the twotarget_link_libraries
invocations into one block:-target_link_libraries(git PRIVATE OpenSSL::Crypto) -target_link_libraries(git PRIVATE ZLIB::ZLIB) +target_link_libraries(git PRIVATE + OpenSSL::Crypto + ZLIB::ZLIB +)starter_templates/cpp/code/CMakeLists.txt (2)
9-10
: Specify required components explicitly for OpenSSL and verify CMake support for ZLIB::ZLIB.Currently you’re using:
find_package(OpenSSL REQUIRED) find_package(ZLIB REQUIRED)– If your code only consumes the Crypto APIs, tighten the OpenSSL call to make the intent explicit:
find_package(OpenSSL REQUIRED COMPONENTS Crypto)
– Also confirm that CMake 3.13 (your declared minimum) ships the
ZLIB::ZLIB
imported target. The alias was only introduced in later CMake releases (≈3.14+). If you encounter “target not found” errors when linking ZLIB, you’ll need to bumpcmake_minimum_required
to a compatible version.
14-15
: Consolidate library links into a single call.You can merge the two
target_link_libraries
invocations for brevity and readability:-target_link_libraries(git PRIVATE OpenSSL::Crypto) -target_link_libraries(git PRIVATE ZLIB::ZLIB) +target_link_libraries(git PRIVATE + OpenSSL::Crypto + ZLIB::ZLIB +)This reduces duplication and keeps your linking logic in one place.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
compiled_starters/c/CMakeLists.txt
(1 hunks)compiled_starters/cpp/CMakeLists.txt
(1 hunks)solutions/c/01-gg4/code/CMakeLists.txt
(1 hunks)solutions/cpp/01-gg4/code/CMakeLists.txt
(1 hunks)starter_templates/c/code/CMakeLists.txt
(1 hunks)starter_templates/cpp/code/CMakeLists.txt
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: test_course_definition / test (zig)
- GitHub Check: test_course_definition / test (kotlin)
- GitHub Check: test_course_definition / test (java)
- GitHub Check: test_course_definition / test (haskell)
- GitHub Check: test_course_definition / test (go)
- GitHub Check: test_course_definition / test (cpp)
- GitHub Check: test_course_definition / test (c)
Summary by CodeRabbit