Migrate to C++ 20 & switch to websocketpp develop branch (#4252)

* feat: c++ 20

* fix: c++ 20 deprecations

* fix(msvc): warnings

* chore: add changelog entry

* fix: formatting

* Update websocketpp to the `develop` branch

* Specify other template type in FlagsEnum != operator

* Remove the user of simple template ids in our websocketpp template class

Also standardizes the file a bit by using nested namespaces, using
pragma once

* fix: turn `MAGIC_MESSAGE_SUFFIX` into a `QString`

* hacky unhacky hacky const char hack

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
nerix
2022-12-24 12:56:11 +01:00
committed by GitHub
parent 99e038ce5e
commit 86e71c8bd9
31 changed files with 219 additions and 212 deletions
+20 -16
View File
@@ -789,28 +789,32 @@ if (MSVC)
# Someone adds /W3 before we add /W4.
# This makes sure, only /W4 is specified.
string(REPLACE "/W3" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
# 4714 - function marked as __forceinline not inlined
# 4996 - occurs when the compiler encounters a function or variable that is marked as deprecated.
# These functions may have a different preferred name, may be insecure or have
# a more secure variant, or may be obsolete.
# 4505 - unreferenced local version has been removed
# 4127 - conditional expression is constant
# 4503 - decorated name length exceeded, name was truncated
# 4100 - unreferences formal parameter
# 4305 - possible truncation of data
# 4267 - possible loss of data in return
# 4505 - "unreferenced local version has been removed"
# Although this might give hints on dead code,
# there are some cases where it's distracting.
#
# 4100 - "unreferenced formal parameter"
# There are a lot of functions and methods where
# an argument was given a name but never used.
# There's a clang-tidy rule that will catch this
# for new/updated functions/methods.
#
# 4267 - "possible loss of data in return"
# These are implicit conversions from size_t to int/qsizetype.
# We don't use size_t in a lot of cases, since
# Qt doesn't use it - it uses int (or qsizetype in Qt6).
target_compile_options(${LIBRARY_PROJECT} PUBLIC
/W4
# Disable the following warnings
/wd4714
/wd4996
# 5038 - warnings about initialization order
/w15038
# 4855 - implicit capture of 'this' via '[=]' is deprecated
/w14855
# Disable the following warnings (see reasoning above)
/wd4505
/wd4127
/wd4503
/wd4100
/wd4305
/wd4267
)
target_compile_definitions(${LIBRARY_PROJECT} PUBLIC NOMINMAX)
else ()
target_compile_options(${LIBRARY_PROJECT} PUBLIC
-Wall