From 3266a9c4660c12f12fc709892816857804a346bf Mon Sep 17 00:00:00 2001 From: Christophe Giboudeaux Date: Thu, 8 Jul 2021 10:59:20 +0200 Subject: [PATCH] Fix build with older openEXR versions Dynamic exception specification is not allowed in c++-17. The enforcement needs to be relaxed for the kimg_exr plugin when using openEXR versions older than 2.3.0. --- src/imageformats/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/imageformats/CMakeLists.txt b/src/imageformats/CMakeLists.txt index 4e59ad4..9fcce83 100644 --- a/src/imageformats/CMakeLists.txt +++ b/src/imageformats/CMakeLists.txt @@ -61,6 +61,11 @@ if(OpenEXR_FOUND) if(TARGET OpenEXR::OpenEXR) target_link_libraries(kimg_exr OpenEXR::OpenEXR) else() + if(OpenEXR_VERSION_STRING VERSION_LESS 2.3.0) + # Older OpenEXR versions use dynamic exception specifications, so + # cannot use C++17 with them + set_target_properties(kimg_exr PROPERTIES CXX_STANDARD 14) + endif() target_link_libraries(kimg_exr OpenEXR::IlmImf) endif() kde_target_enable_exceptions(kimg_exr PRIVATE)