From ae20ab3ce24267123bccca3013bc7f960ce850d3 Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Sun, 21 Jan 2024 17:50:26 +0100 Subject: [PATCH] fix CMAKE_C_SIMULATE_ID --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index df3970bd..8b6f74a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,10 +48,10 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang") endif() endif() -if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_SIMULATE_ID MATCHES "MSVC") +if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND CMAKE_C_SIMULATE_ID MATCHES "MSVC") # error: 'strdup' is deprecated: The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _strdup. # "strdup" is standard since C23 - add_compile_options(-D _CRT_NONSTDC_NO_DEPRECATE) + add_definitions(-D _CRT_NONSTDC_NO_DEPRECATE) # ignore "'fopen' is deprecated" and "'strncpy' is deprecated" warnings # TODO: replace by fopen_s and strncpy_s in C11 add_definitions(-D _CRT_SECURE_NO_WARNINGS)