Use C++ 20 when compiling with MSVC as it requires it for designated initializers

This commit is contained in:
Martchus 2023-01-26 22:23:46 +01:00
parent 38fa3512fd
commit b6fa13f8dd
1 changed files with 5 additions and 1 deletions

View File

@ -120,7 +120,11 @@ endif ()
# set default CXX_STANDARD for all library, application and test targets
if (NOT META_CXX_STANDARD)
set(META_CXX_STANDARD 17)
if (MSVC)
set(META_CXX_STANDARD 20) # MSVC needs C++ 20 mode for designated initializers
else ()
set(META_CXX_STANDARD 17)
endif ()
endif ()
# set version to 0.0.0 if not specified explicitly