From 0f5a767bb581c421f65a541754ccd3bf83a3781d Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Sat, 18 Apr 2015 21:54:05 +0200 Subject: [PATCH 3/3] cmake: Add msvc support for sign-compare warnings. --- cmake/CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 6fbe23e..28de329 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -202,8 +202,13 @@ if(DBUS_WITH_GLIB) endif() SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG") -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wsign-compare") -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsign-compare") +if(MSVC) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w14018") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w14018") +else() + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wsign-compare") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsign-compare") +endif() ######################################################################### # Windows CE (>= 5.0.0) -- 1.8.4.5