From 995c7dbfbbb7b38c4ad6ce59d66b01b53ef031b2 Mon Sep 17 00:00:00 2001 From: Ben Ashbaugh Date: Tue, 31 Aug 2021 11:44:17 -0700 Subject: [PATCH] suppress MSVC strdup warning (#1314) --- CMakeLists.txt | 2 ++ test_common/CMakeLists.txt | 5 ----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 04551dfb..7b307a11 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,6 +115,8 @@ endif() if(MSVC) # Don't warn when using standard non-secure functions. add_compile_definitions(_CRT_SECURE_NO_WARNINGS) + # Don't warn about using the portable "strdup" function. + add_compile_definitions(_CRT_NONSTDC_NO_DEPRECATE) # Fix std::min and std::max handling with windows.harness. add_compile_definitions(NOMINMAX) endif() diff --git a/test_common/CMakeLists.txt b/test_common/CMakeLists.txt index 61580300..b0505345 100644 --- a/test_common/CMakeLists.txt +++ b/test_common/CMakeLists.txt @@ -21,8 +21,3 @@ set(HARNESS_SOURCES ) add_library(harness STATIC ${HARNESS_SOURCES}) - -if(MSVC) - # Don't warn about using the portable "strdup" function. - target_compile_definitions(harness PRIVATE _CRT_NONSTDC_NO_DEPRECATE) -endif() \ No newline at end of file