Skip to content

Commit cf5bee8

Browse files
committed
fix: only treat warnings as errors in newer gcc
The gcc versions older than 4.3 cannot build the current code base without warnings, which are treated as errors, hence cannot build argtable3. Besides, these old versions cannot enforce standard compliance properly. In this patch, we enhance the CMakeList.txt script so we don't treat warnings as errors in very old gcc versions.
1 parent b50c6c8 commit cf5bee8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ else(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
4646
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion")
4747
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra")
4848
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
49-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
50-
if ((CMAKE_C_COMPILER_ID MATCHES "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.2)
49+
if ((CMAKE_C_COMPILER_ID MATCHES "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.3)
5150
OR CMAKE_C_COMPILER_ID MATCHES "Clang")
51+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
5252
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpedantic")
5353
endif()
5454
endif()

0 commit comments

Comments
 (0)