Skip to content

Commit

Permalink
[FIXED] Build: failure with mingw
Browse files Browse the repository at this point in the history
Credit goes to @mtmk with the proposed fix and verification that it
works on mingw.

I have verified that the change still works when building on my Windows
VM, so I don't expect windows users to have any issue with that.

Resolves #827

Signed-off-by: Ivan Kozlovic <[email protected]>
  • Loading branch information
kozlovic committed Dec 19, 2024
1 parent ecdff33 commit 9556761
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,16 @@ elseif(WIN32)
set(NATS_PLATFORM_INCLUDE "win")

# Warning control.
add_compile_options(/W4) # Set warning level to maximum, then disable:
add_compile_options(/wd4100) # unreferenced formal parameter
add_compile_options(/wd4200) # nonstandard extension used: zero-sized array in struct/union
add_compile_options(/wd4130) # logical operation on address of string constant
add_compile_options(/wd4127) # conditional expression is constant
if(MSVC)
# Set warning level to maximum, then disable:
# /wd4100 unreferenced formal parameter
# /wd4200 nonstandard extension used: zero-sized array in struct/union
# /wd4130 logical operation on address of string constant
# /wd4127 conditional expression is constant
add_compile_options(/W4 /wd4100 /wd4200 /wd4130 /wd4127)
else()
add_compile_options(-Wall -Wextra -Wno-unused-parameter -Wno-pedantic -Wno-address -Wno-constant-conditional)
endif()

if(sodium_USE_STATIC_LIBS)
add_definitions(
Expand Down

0 comments on commit 9556761

Please sign in to comment.