Silence some CMake build MSVC useless warnings
authorevpobr <evpobr@gmail.com>
Wed, 8 Apr 2020 05:28:27 +0000 (10:28 +0500)
committerRalph Giles <giles@thaumas.net>
Wed, 8 Apr 2020 23:50:49 +0000 (16:50 -0700)
Supress warnings about unsafe and deprecated functions like this: strcat is unsafe, use `strcat_s` instead and so on.

Signed-off-by: Ralph Giles <giles@thaumas.net>
lib/CMakeLists.txt

index 7e8ca4562b36fabb7acc436100a76bc17427f58f..7cd68e50991efb3dad33d3f532fabe81cdda4958 100644 (file)
@@ -67,6 +67,12 @@ if(WIN32)
     list(APPEND VORBISFILE_SOURCES ../win32/vorbisfile.def)
 endif()
 
+if(MSVC)
+    add_definitions(-D_CRT_SECURE_NO_WARNINGS)
+    add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
+    add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
+endif()
+
 if (NOT BUILD_FRAMEWORK)
     add_library(vorbis ${VORBIS_HEADERS} ${VORBIS_SOURCES})
     add_library(vorbisenc ${VORBISENC_SOURCES})