From 5d7f2fd438473770cce86c7a317436d2ed2c71a5 Mon Sep 17 00:00:00 2001 From: Erik Boasson Date: Thu, 25 Jun 2020 18:01:33 +0200 Subject: [PATCH] Compile applink.c with -D_CRT_SECURE_NO_WARNINGS Signed-off-by: Erik Boasson --- src/security/builtin_plugins/tests/CMakeLists.txt | 5 +++++ src/security/core/tests/CMakeLists.txt | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/security/builtin_plugins/tests/CMakeLists.txt b/src/security/builtin_plugins/tests/CMakeLists.txt index b5f0dab..8d94baa 100644 --- a/src/security/builtin_plugins/tests/CMakeLists.txt +++ b/src/security/builtin_plugins/tests/CMakeLists.txt @@ -65,6 +65,11 @@ add_cunit_executable(cunit_security_plugins ${security_crypto_test_sources} ${CYCLONEDDS_OPENSSL_APPLINK}) +# applink.c triggers the dreaded This function or variable may be unsafe +if(NOT "${CYCLONEDDS_OPENSSL_APPLINK}" STREQUAL "") + set_source_files_properties("${CYCLONEDDS_OPENSSL_APPLINK}" PROPERTIES COMPILE_FLAGS "-D_CRT_SECURE_NO_WARNINGS") +endif() + target_include_directories( cunit_security_plugins PRIVATE "$" diff --git a/src/security/core/tests/CMakeLists.txt b/src/security/core/tests/CMakeLists.txt index 6b30b63..ac055ef 100644 --- a/src/security/core/tests/CMakeLists.txt +++ b/src/security/core/tests/CMakeLists.txt @@ -84,6 +84,10 @@ if(ENABLE_SSL AND OPENSSL_FOUND) "plugin_loading.c" "secure_communication.c" ${CYCLONEDDS_OPENSSL_APPLINK}) + # applink.c triggers the dreaded This function or variable may be unsafe + if(NOT "${CYCLONEDDS_OPENSSL_APPLINK}" STREQUAL "") + set_source_files_properties("${CYCLONEDDS_OPENSSL_APPLINK}" PROPERTIES COMPILE_FLAGS "-D_CRT_SECURE_NO_WARNINGS") + endif() endif() add_cunit_executable(cunit_security_core ${security_core_test_sources})