From 7ec6692315ead1e75cdf4ce064bf5046b33a73f7 Mon Sep 17 00:00:00 2001 From: cristian64 Date: Sat, 8 Nov 2025 11:07:00 +0000 Subject: [PATCH] CMakeLists: Disable `-Wtrigraphs`. Trigraphs support is generally disabled by default, but some compilers (e.g. GCC) may still warn when one hypothetical trigraph is encountered. For example, one of these warnings was introduced as part of #14067: ``` .../Source/Core/DolphinQt/MainWindow.cpp:1433:77: warning: trigraph ??) ignored, use -trigraphs to enable [-Wtrigraphs] 1433 | this, tr("Select a File"), dialog_path, tr("All Save States (*.sav *.s??);; All Files (*)")); | .../Source/Core/DolphinQt/MainWindow.cpp:1445:77: warning: trigraph ??) ignored, use -trigraphs to enable [-Wtrigraphs] 1445 | this, tr("Select a File"), dialog_path, tr("All Save States (*.sav *.s??);; All Files (*)")); | ``` The warning is generally not interesting and has been disabled now. --- Source/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 466fc2e90f8..8d74b60470e 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -60,6 +60,13 @@ else() if (HAS_FORMAT_WARNING) check_and_add_flag(FORMAT_WARNING_TO_ERROR -Werror=format) endif() + + # Trigraphs support is generally disabled by default, but some compilers (GCC) may still warn when + # one hypothetical trigraph is encountered. The warning is generally not interesting. + check_cxx_compiler_flag(-Wtrigraphs HAS_TRIGRAPHS_WARNING) + if (HAS_TRIGRAPHS_WARNING) + check_and_add_flag(NO_TRIGRAPHS_WARNING -Wno-trigraphs) + endif() endif() # These aren't actually needed for C11/C++11