build: disable conversion warnings for older GCC versions

The conversion warnings from GCC versions 10 and less give too many
false positives and should be disabled.
This commit is contained in:
dundargoc 2024-01-14 13:21:13 +01:00 committed by dundargoc
parent e5ff71fbbf
commit 310fb2efc3

View File

@ -117,6 +117,10 @@ elseif(MINGW)
# Enable wmain
target_link_libraries(nvim PRIVATE -municode)
elseif(CMAKE_C_COMPILER_ID STREQUAL "GNU")
if(CMAKE_C_COMPILER_VERSION VERSION_LESS 10)
target_compile_options(main_lib INTERFACE -Wno-conversion)
endif()
target_compile_options(main_lib INTERFACE -fno-common
$<$<CONFIG:Release>:-Wno-unused-result>
$<$<CONFIG:RelWithDebInfo>:-Wno-unused-result>