build: Fix Visual Studio warnings.

This commit is contained in:
Andreas Schneider 2011-05-31 21:08:32 +02:00
parent c0d1b69a2f
commit 8e41ffb9b5
1 changed files with 5 additions and 2 deletions

View File

@ -63,6 +63,9 @@ if (UNIX AND NOT WIN32)
endif (UNIX AND NOT WIN32)
if (MSVC)
# Suppress warning about "deprecated" functions
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -nologo -D_CRT_SECURE_NO_WARNINGS -D_WIN32_WINNT=0x501")
# Use secure functions by defaualt and suppress warnings about
#"deprecated" functions
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_NONSTDC_NO_WARNINGS=1 /D _CRT_SECURE_NO_WARNINGS=1")
endif (MSVC)