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.
This commit is contained in:
cristian64 2025-11-08 11:07:00 +00:00
parent 4f849ec827
commit 7ec6692315

View File

@ -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