Skip to content

Use C++17 to build if we find POCO 1.14 or higher. #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

kblaschke
Copy link
Member

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.

@@ -75,6 +75,11 @@ find_package(projectM4 REQUIRED COMPONENTS Playlist)
find_package(SDL2 REQUIRED)
find_package(Poco REQUIRED COMPONENTS JSON XML Util Foundation)

if(Poco_VERSION VERSION_GREATER_EQUAL 1.14.0)
# POCO 1.14 requires at least C++17
set(CMAKE_CXX_STANDARD 17)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will it not overwrite if we're using a newer version?

Copy link
Member Author

@kblaschke kblaschke Mar 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@kblaschke kblaschke merged commit 080e48b into projectM-visualizer:master Mar 18, 2025
3 checks passed
@kblaschke kblaschke deleted the fix-build-with-poco-1.14 branch March 18, 2025 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants