@@ -60,7 +60,6 @@ endif ()
6060# Set boost/stacktrace use backtrace api to unwind
6161if (NOT OS_MACOSX)
6262 add_definitions (-DBOOST_STACKTRACE_USE_BACKTRACE )
63- #add_definitions(-DPRINT_ALL_ERR_STATUS_STACKTRACE)
6463else ()
6564 add_definitions (-DBOOST_STACKTRACE_USE_NOOP )
6665endif ()
@@ -118,8 +117,8 @@ option(WITH_MYSQL "Support access MySQL" ON)
118117
119118# Check gcc
120119if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
121- if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "11.0 " )
122- message (FATAL_ERROR "Need GCC version at least 11.0 " )
120+ if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "11.1 " )
121+ message (FATAL_ERROR "Need GCC version at least 11.1 " )
123122 endif ()
124123endif ()
125124
@@ -490,27 +489,25 @@ if (NOT CUSTUM_LINKER_COMMAND STREQUAL "ld")
490489 set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=${CUSTUM_LINKER_COMMAND} " )
491490endif ()
492491
493- if (USE_LIBCPP AND COMPILER_CLANG)
494- set (CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -stdlib=libc++" )
495- if (NOT OS_MACOSX)
496- set (CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -lstdc++" )
497- endif ()
498- add_definitions (-DUSE_LIBCPP )
499- endif ()
500-
501492if (COMPILER_GCC)
502- # Avoid GCC 11 false alarm
503- # https://stackoverflow.com/questions/67584073/gcc-11-false-array-subscript-is-partly-outside-array-bounds-warning
504- # https://stackoverflow.com/questions/69426070/gcc-11-order-of-arguments-triggers-false-positive-wstringop-overflow-is-this-bu
505- set (CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-array-bounds -Wno-stringop-overread" )
506- add_compile_options (-Wno-stringop-overflow -fdiagnostics-color=always )
493+ add_compile_options (-fdiagnostics-color=always -Wno-array-bounds -Wno-stringop-overread )
507494endif ()
508495
509496if (COMPILER_CLANG)
510- add_compile_options (-fcolor-diagnostics -fno-limit-debug-info )
497+ add_compile_options (-fcolor-diagnostics -fno-limit-debug-info -Wpedantic )
498+ add_compile_options (-Wno-zero-length-array -Wno-variadic-macros -Wno-gnu-zero-variadic-macro-arguments -Wno-vla-extension -Wno-c++20-designator -Wno-gnu-label-as-value -Wno-embedded-directive -Wno-array-bounds )
511499 if (MAKE_TEST STREQUAL "OFF" )
512500 add_compile_options (-Qunused-arguments )
513501 endif ()
502+ if (USE_LIBCPP)
503+ add_compile_options (-stdlib=libc++ )
504+ if (NOT OS_MACOSX)
505+ add_compile_options (-lstdc++ )
506+ endif ()
507+ add_definitions (-DUSE_LIBCPP )
508+ else ()
509+ add_compile_options (-Wno-c++20-attribute-extensions )
510+ endif ()
514511endif ()
515512
516513# https://github.com/boostorg/uuid/issues/92
0 commit comments