From 01cbf13f0b898b39c3bc361ec49528bf2f537b72 Mon Sep 17 00:00:00 2001 From: Andreas Rogge Date: Mon, 7 Nov 2022 13:54:36 +0100 Subject: python-fd: force C++17 for python modules C++20 supports designated initializers. However, it doesn't allow mixing of named and unnamed initialization. As we need to use the PyVarObject_HEAD_INIT() macro, which doesn't name the attributes it sets, we have to downgrade the compiler to C++17, so designated initializers are handled as compiler extension, which will allow the mixing that occurs here. See also: https://github.com/python/cpython/issues/99202 --- core/src/plugins/filed/python/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/plugins/filed/python/CMakeLists.txt b/core/src/plugins/filed/python/CMakeLists.txt index 08af03d73..f81513766 100644 --- a/core/src/plugins/filed/python/CMakeLists.txt +++ b/core/src/plugins/filed/python/CMakeLists.txt @@ -116,6 +116,7 @@ if(Python2_FOUND) LINK_FLAGS "${Python2_BLDSHARED_FLAGS}" LINKER_LANGUAGE CXX INCLUDE_DIRECTORIES "${pymod2_include_dirs}" + CXX_STANDARD 17 ) target_compile_options(bareosfd-python2-module PUBLIC -fno-strict-aliasing) if(NOT "${Python2_CCSHARED}" STREQUAL "") @@ -154,6 +155,7 @@ if(Python3_FOUND) LINK_FLAGS "${Python3_BLDSHARED_FLAGS}" LINKER_LANGUAGE CXX INCLUDE_DIRECTORIES "${pymod3_include_dirs}" + CXX_STANDARD 17 ) target_compile_options(bareosfd-python3-module PUBLIC -fno-strict-aliasing) if(NOT "${Python3_CCSHARED}" STREQUAL "") -- cgit v1.2.3