Skip to content

Commit

Permalink
CMake: Reduce warnings in MSVC build.
Browse files Browse the repository at this point in the history
In the MSVC build, `-Wall` isn't as useful as it includes warnings
about padding in structs which is quite spammy.
  • Loading branch information
waywardmonkeys committed Dec 20, 2022
1 parent db0eb55 commit 33a3c47
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mindy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ ENDIF()

OPTION(MINDY_USE_SIGNALS "Use signals." ${MINDY_USE_SIGNALS})

IF(MSVC)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
ENDIF()

CHECK_FUNCTION_EXISTS(_setjmp HAVE__SETJMP)
CHECK_FUNCTION_EXISTS(_longjmp HAVE__LONGJMP)

Expand Down Expand Up @@ -90,7 +94,9 @@ ENDIF()

ADD_DEFINITIONS(-DLIBDIR="${CMAKE_INSTALL_PREFIX}/${MINDY_LIB_DIR}")

ADD_C_COMPILER_FLAG(-Wall)
IF(NOT MSVC)
ADD_C_COMPILER_FLAG(-Wall)
ENDIF()

# clang doesn't print colored diagnostics when invoked from Ninja
IF (UNIX AND
Expand Down

0 comments on commit 33a3c47

Please sign in to comment.