Skip to content

Build system modernization and warning fixes - #9

Open
dfateyev wants to merge 4 commits into
halon:masterfrom
dfateyev:update-cmake-build
Open

Build system modernization and warning fixes#9
dfateyev wants to merge 4 commits into
halon:masterfrom
dfateyev:update-cmake-build

Conversation

@dfateyev

Copy link
Copy Markdown
Contributor

This PR cleans up all compiler warnings surfaced except the OpenSSL 3.0 deprecation notices, and modernizes the CMake rules.

  • Fix -Wconversion and -Wsign-compare warnings — cast std::string::size() to int for BIO_write(), use std::streamsize when comparing against istream::gcount().
  • Initialize md_nid to NID_undef — the digest algorithm switch has no default branch; a future unhandled enum value would pass an uninitialized NID to RSA_sign/RSA_verify. Also silences -Wmaybe-uninitialized.
  • Modernize CMake rules — drop hardcoded /usr/local paths in favor of pkg-config results (we no longer need to patch them out), install the library via INSTALL(TARGETS) instead of hand-written INSTALL(FILES) rules, link OpenSSL through imported targets, set the C++ standard via CMAKE_CXX_STANDARD, only set CMAKE_BUILD_TYPE when not provided, replace deprecated SUBDIRS().
  • Update pkg-config file — reference RFC6376 instead of the obsoleted RFC4871, add Requires.private for static consumers.

dfateyev added 4 commits July 30, 2026 00:49
Cast std::string::size() to int for BIO_write, and use
std::streamsize for the loop comparing against istream::gcount().
- Fix -Wmaybe-uninitialized occurrences
- Make RSA_sign/RSA_verify fail cleanly
- Set the C++ standard via CMAKE_CXX_STANDARD
- Drop hardcoded /usr/local paths in favor of pkg-config results
- Install the library via INSTALL(TARGETS) instead of hand-written
  INSTALL(FILES) rules
- Link OpenSSL through imported targets
- Only set CMAKE_BUILD_TYPE when not provided
- Replace deprecated SUBDIRS() with ADD_SUBDIRECTORY()
- Reference RFC6376 (which obsoleted RFC4871) in the description
- Declare libssl, libcrypto and libsodium in Requires.private
  so that static builders get the full dependency chain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant