Don't set CMAKE_CXX_STANDARD to 11 by default

Use the compiler default C++ dialect if it is C++11 or higher and only
explicitly request C++11 if the compiler can't compile a small test
using C++11 features by default.

This prevents from unnecessarily adding -std=c++11 to the compiler flags
under Unix, even with compilers using e.g. C++17 by default.
This commit is contained in:
Vadim Zeitlin 2024-01-04 03:30:00 +01:00
parent 5faa70503a
commit 3b06ab65ff
3 changed files with 19 additions and 5 deletions

View file

@ -97,9 +97,6 @@ endif()
project(wxWidgets VERSION ${wxVERSION} LANGUAGES ${wxLANGUAGES})
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(build/cmake/main.cmake)
# Set the default startup project for Visual Studio