aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorWan-Teh Chang <wtc@google.com>2022-08-03 09:53:43 -0700
committerFrank Barchard <fbarchard@chromium.org>2022-08-03 21:18:02 +0000
commitab046f1dfc7baf4ef2ebe749aa0c8dfaa7c6d13d (patch)
tree29c295ea02a236d001d37b9c13073c901eb7444d /CMakeLists.txt
parent02b8b885482282f3e5643bf6d44ac6e5cf7ee743 (diff)
downloadlibyuv-ab046f1dfc7baf4ef2ebe749aa0c8dfaa7c6d13d.tar.gz
Define _CRT_SECURE_NO_WARNINGS if MSVC CRT is used
Suppress the following MSVC compiler warnings: src\source\cpu_id.cc(140): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. src\source\cpu_id.cc(169): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. Note that build/config/win/BUILD.gn defines _CRT_SECURE_NO_DEPRECATE instead. _CRT_SECURE_NO_WARNINGS is the new name of the macro. See https://docs.microsoft.com/en-us/cpp/c-runtime-library/security-features-in-the-crt?view=msvc-140 Bug: libyuv:939 Change-Id: I0d1715b31e672126c35e29b99f5cbf08e4338f40 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3807104 Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 404c8a67..d190507b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,6 +22,10 @@ LIST ( SORT ly_unittest_sources )
INCLUDE_DIRECTORIES( BEFORE ${ly_inc_dir} )
+if(MSVC)
+ ADD_DEFINITIONS ( -D_CRT_SECURE_NO_WARNINGS )
+endif()
+
# this creates the static library (.a)
ADD_LIBRARY ( ${ly_lib_static} STATIC ${ly_source_files} )