From 2505489d2952f1df5c27bdc1a5a242b582da70ba Mon Sep 17 00:00:00 2001 From: Serge Gautherie <32623169+SergeGautherie@users.noreply.github.com> Date: Wed, 17 Jan 2024 16:32:46 +0100 Subject: [PATCH] [MKISOFS] CMakeLists.txt: Add a check for Clang and its version (#6369) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- sdk/tools/mkisofs/CMakeLists.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sdk/tools/mkisofs/CMakeLists.txt b/sdk/tools/mkisofs/CMakeLists.txt index bd25bf36403..1b4c2116035 100644 --- a/sdk/tools/mkisofs/CMakeLists.txt +++ b/sdk/tools/mkisofs/CMakeLists.txt @@ -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()