From c64b03d5e4da4605be47746ceb3e2f7bbb5fff72 Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Mon, 8 Jan 2024 04:54:07 +0800 Subject: [PATCH] Do not use -Wpedantic with old Xcode gcc Fixes: https://github.com/argtable/argtable3/issues/88 --- src/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 624477f..c811264 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -39,9 +39,12 @@ if(CMAKE_C_COMPILER_ID MATCHES "MSVC") else(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c89") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpedantic") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") + if ((CMAKE_C_COMPILER_ID MATCHES "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.2) + OR CMAKE_C_COMPILER_ID MATCHES "Clang") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpedantic") + endif() endif() if(ARGTABLE3_ENABLE_ARG_REX_DEBUG)