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})