Commit e6a51bd6ae3e8c79b19d384fcb768cc894526e7d

Craig Barnes 2018-07-12T03:37:09

Add "-Wall" to CFLAGS when using Clang as compiler See also: * https://cmake.org/cmake/help/v3.12/variable/CMAKE_LANG_COMPILER_ID.html * https://cmake.org/cmake/help/v3.12/variable/CMAKE_COMPILER_IS_GNUCC.html

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a32d7d8..a62798f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,7 +13,7 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "")
 endif()
 
 
-if(CMAKE_COMPILER_IS_GNUCC)
+if(${CMAKE_C_COMPILER_ID} MATCHES GNU|Clang)
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
 elseif(MSVC)
     # Disable warnings about the so-called unsecured functions: