Use C++17 to build if we find POCO 1.14 or higher.#97
Conversation
|
|
||
| if(Poco_VERSION VERSION_GREATER_EQUAL 1.14.0) | ||
| # POCO 1.14 requires at least C++17 | ||
| set(CMAKE_CXX_STANDARD 17) |
There was a problem hiding this comment.
will it not overwrite if we're using a newer version?
There was a problem hiding this comment.
This block simply checks if the found POCO version is 1.14.0 or higher, and in this case sets the required C++ standard to C++17 for the app's compilation (CMAKE_CXX_STANDARD default-initializes the CXX_STANDARD property of targets defined later on to the given value, which makes the build system pass -std=c++17 or -std=gnu++17 to the compiler).
The logic is, if we have POCO 1.14, we should also have a C++17-capable toolchain since otherwise, we'd have many other issues like mismatching C++ runtimes etc., but keeping C++14 as the minimum requirement if someone builds the application in an environment that uses an older toolchain and POCO version (e.g. Ubuntu 22 or the default Steam Runtime v3 compiler, which is GCC 10).
POCO 1.14. now requires C++17 to be used. This application doesn't have this hard requirement, so we now adapt the build process accordingly to use C++17 if POCO 1.14.0 or higher is found.