File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -479,9 +479,6 @@ PYBIND11_WARNING_POP
479
479
}
480
480
481
481
\endrst */
482
- PYBIND11_WARNING_PUSH
483
- PYBIND11_WARNING_DISABLE_GCC(" -Wpedantic" )
484
- PYBIND11_WARNING_DISABLE_CLANG(" -Wgnu-zero-variadic-macro-arguments" )
485
482
#define PYBIND11_MODULE (name, variable, ...) \
486
483
static ::pybind11::module_::module_def PYBIND11_CONCAT (pybind11_module_def_, name) \
487
484
PYBIND11_MAYBE_UNUSED; \
@@ -502,7 +499,6 @@ PYBIND11_WARNING_DISABLE_CLANG("-Wgnu-zero-variadic-macro-arguments")
502
499
PYBIND11_CATCH_INIT_EXCEPTIONS \
503
500
} \
504
501
void PYBIND11_CONCAT (pybind11_init_, name)(::pybind11::module_ & (variable))
505
- PYBIND11_WARNING_POP
506
502
507
503
PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
508
504
Original file line number Diff line number Diff line change @@ -377,12 +377,14 @@ function(pybind11_enable_warnings target_name)
377
377
${target_name}
378
378
PRIVATE -Wall
379
379
-Wextra
380
- -Wpedantic
381
380
-Wconversion
382
381
-Wcast-qual
383
382
-Wdeprecated
384
383
-Wundef
385
384
-Wnon-virtual-dtor )
385
+ if (DEFINED CMAKE_CXX_STANDARD AND NOT CMAKE_CXX_STANDARD VERSION_LESS 20 )
386
+ target_compile_options (${target_name} PRIVATE -Wpedantic )
387
+ endif ()
386
388
endif ()
387
389
388
390
if (PYBIND11_WERROR )
You can’t perform that action at this time.
0 commit comments