From 0347a276ea5e19715bbeda2f3719fa2828166db0 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Fri, 9 Aug 2024 22:54:57 +0200 Subject: [PATCH] Silenced some Clang compiler warnings --- CMakeLists.txt | 3 ++- es-core/src/utils/StringUtil.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 301a4d60e..c9293f2dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -217,7 +217,8 @@ else() endif() endif() -if(APPLE AND CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 15.0.0) +# Silence some annoying warnings caused by invalid characters in some FreeImage source comments. +if(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 15.0.0) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-utf8") endif() diff --git a/es-core/src/utils/StringUtil.cpp b/es-core/src/utils/StringUtil.cpp index f3f1f0bcc..9784323c1 100644 --- a/es-core/src/utils/StringUtil.cpp +++ b/es-core/src/utils/StringUtil.cpp @@ -9,7 +9,7 @@ // Suppress codecvt deprecation warnings. #if defined(_MSC_VER) // MSVC compiler. #define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING -#elif defined(__APPLE__) +#elif defined(__clang__) #pragma clang diagnostic ignored "-Wdeprecated-declarations" #endif