File tree Expand file tree Collapse file tree 3 files changed +28
-1
lines changed
Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,13 @@ cc_library(
1717 name = "ncrypto" ,
1818 srcs = glob (["src/*.cpp" ]),
1919 hdrs = glob (["include/*.h" , "include/ncrypto/*.h" ]),
20+ copts = [
21+ "-Werror" ,
22+ "-Wextra" ,
23+ "-Wno-unused-parameter" ,
24+ "-Wimplicit-fallthrough" ,
25+ "-Wno-deprecated-declarations" , # OpenSSL 3.0 deprecates many APIs we intentionally use
26+ ],
2027 includes = ["include" ],
2128 local_defines = {
2229 "NCRYPTO_BSSL_LIBDECREPIT_MISSING" : select (
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ class Aead final {
1919
2020 public:
2121 Aead () = default ;
22- Aead (const AeadInfo* info, const EVP_AEAD* aead) : info_(info ), aead_(aead ) {}
22+ Aead (const AeadInfo* info, const EVP_AEAD* aead) : aead_(aead ), info_(info ) {}
2323 Aead (const Aead&) = default ;
2424 Aead& operator =(const Aead&) = default ;
2525 NCRYPTO_DISALLOW_MOVE (Aead)
Original file line number Diff line number Diff line change 11add_library (ncrypto ncrypto.cpp engine.cpp aead.cpp )
2+
3+ # Enable strict warning flags for ncrypto sources only
4+ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang" )
5+ target_compile_options (ncrypto PRIVATE
6+ -Werror
7+ -Wextra
8+ -Wno-unused-parameter
9+ -Wimplicit-fallthrough
10+ -Wno-deprecated-declarations # OpenSSL 3.0 deprecates many APIs we intentionally use
11+ )
12+ elseif (MSVC )
13+ target_compile_options (ncrypto PRIVATE
14+ /WX # Treat warnings as errors
15+ /W3 # Warning level 3 (production quality)
16+ /wd4100 # Unreferenced formal parameter (like -Wno-unused-parameter)
17+ /wd4267 # Conversion from 'size_t' to smaller type
18+ /wd4244 # Conversion, possible loss of data
19+ )
20+ endif ()
21+
222if (NCRYPTO_SHARED_LIBS)
323 target_link_libraries (ncrypto PUBLIC OpenSSL::SSL OpenSSL::Crypto )
424else ()
You can’t perform that action at this time.
0 commit comments