Commit e1b41876112edcbf312d97b7e28e9ac7d0bd5dab

Giuseppe D'Angelo 2020-12-14T01:24:56

Enable more warnings when building under GCC/Clang

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 05f86ad..4af21f9 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -7,6 +7,9 @@ set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG")
 
 configure_file(md4c.pc.in md4c.pc @ONLY)
 add_library(md4c md4c.c md4c.h)
+if(CMAKE_C_COMPILER_ID MATCHES "Clang|GNU")
+    target_compile_options(md4c PRIVATE -Wall -Wextra)
+endif()
 set_target_properties(md4c PROPERTIES
     COMPILE_FLAGS "-DMD4C_USE_UTF8"
     VERSION ${MD_VERSION}