CMake: Pass -Wno-format with MinGW

This commit is contained in:
Sebastian Pipping 2023-09-20 18:39:21 +02:00
parent 4642553bb8
commit 74dbef1552

View file

@ -311,6 +311,10 @@ if (EXPAT_WARNINGS_AS_ERRORS)
add_definitions(/WX)
else()
set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -Werror")
if(MINGW)
# To avoid "error: unknown conversion type character l in format [-Werror=format=]"
set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -Wno-format")
endif()
endif()
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_COMPILE_FLAGS}")