Build system modernization and warning fix - #17
Open
dfateyev wants to merge 2 commits into
Open
Conversation
AF_INET/AF_INET6 constants and addrinfo::ai_family are plain int,
so declare "proto" as int instead of unsigned int.
smtpping-1.1.5-build/smtpping-1.1.5/smtpping.cpp:558:45: warning:
comparison of integer expressions of different signedness:
‘int’ and ‘unsigned int’ [-Wsign-compare]
558 | if (proto && res->ai_family != proto)
| ~~~~~~~~~~~~~~~^~~~~~~~
- Enable only the CXX language needed - Include GNUInstallDirs so bin/man install locations follow platform conventions out of the box - BIN_INSTALL_DIR and MAN_INSTALL_DIR are still honored as command-line overrides if anyone still uses it - Use FindThreads (Threads::Threads) instead of linking pthread directly - Scope the Darwin BIND_8_COMPAT define to the target
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR fixes the compiler warning surfaced by a hardened build (GCC 16, -Wall) and modernizes the CMake rules.
-Wsign-comparewarning in address family check —AF_INET/AF_INET6constants andaddrinfo::ai_familyare plainint, so declareprotoasintinstead ofunsigned int.GNUInstallDirsand target-based commands — includeGNUInstallDirsso bin/man install locations follow platform conventions out of the box (we no longer need to pass-DMAN_INSTALL_DIRor similar;BIN_INSTALL_DIR/MAN_INSTALL_DIRare still honored as overrides for backward compatibility). UseFindThreads(Threads::Threads)instead of linkingpthreaddirectly, enable only the CXX language, and scope the DarwinBIND_8_COMPATdefine to the target.