diff options
author | Andreas Rogge <andreas.rogge@bareos.com> | 2022-11-07 15:54:36 +0300 |
---|---|---|
committer | Andreas Rogge <andreas.rogge@bareos.com> | 2022-11-07 19:16:30 +0300 |
commit | 01cbf13f0b898b39c3bc361ec49528bf2f537b72 (patch) | |
tree | 091212a52ca80c602ac8307700ace2a3a6fb109c | |
parent | b1c6f2cecd92a881e7929631527a766130565397 (diff) |
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
-rw-r--r-- | core/src/plugins/filed/python/CMakeLists.txt | 2 |
1 files changed, 2 insertions, 0 deletions
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 "") |