Avoid passing a C++-only flag when compiling C files

Avoids compiler warnings. This can happen because zlib and libpng are both C projects,
and we build them from source if they are unavailable.
This commit is contained in:
ISSOtm
2026-03-25 17:11:46 +01:00
parent 4b69d5cc8a
commit 0692d1d28c

View File

@@ -53,7 +53,7 @@ if(MSVC)
add_compile_options(/fsanitize=address) # Note that this shouldn't be passed to the linker.
endif()
else()
add_compile_options(-Wall -pedantic -fno-exceptions -fno-rtti -Wno-unknown-warning-option
add_compile_options(-Wall -pedantic -fno-exceptions $<$<COMPILE_LANGUAGE:CXX>:-fno-rtti> -Wno-unknown-warning-option
# C++20 allows macros to take zero variadic arguments.
# Some versions of Clang don't recognize this, and treat them as a GNU extension.
-Wno-gnu-zero-variadic-macro-arguments)