[MKISOFS] CMakeLists.txt: Add a check for Clang and its version (#6369)

GCC 8.4 and Clang 13.0.1:
`cc1: note: unrecognized command-line option ‘-Wno-deprecated-non-prototype’ may have been intended to silence earlier diagnostics`

Addendum to commit 4e3bf252d
This commit is contained in:
Serge Gautherie 2024-01-17 16:32:46 +01:00 committed by GitHub
parent d4a453ca2e
commit 2505489d29
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -107,10 +107,12 @@ else()
# Silence compilers checking for invalid formatting sequences.
target_compile_options(libschily PRIVATE "-Wno-format")
# mkisofs uses K&R-style function definitions to support very old compilers.
# This causes warnings with modern compilers.
target_compile_options(libmdigest PRIVATE "-Wno-deprecated-non-prototype")
target_compile_options(libschily PRIVATE "-Wno-deprecated-non-prototype")
target_compile_options(libsiconv PRIVATE "-Wno-deprecated-non-prototype")
target_compile_options(mkisofs PRIVATE "-Wno-deprecated-non-prototype")
if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "15")
# mkisofs uses K&R-style function definitions to support very old compilers.
# This causes warnings with modern compilers.
target_compile_options(libmdigest PRIVATE "-Wno-deprecated-non-prototype")
target_compile_options(libschily PRIVATE "-Wno-deprecated-non-prototype")
target_compile_options(libsiconv PRIVATE "-Wno-deprecated-non-prototype")
target_compile_options(mkisofs PRIVATE "-Wno-deprecated-non-prototype")
endif()
endif()