Skip to content

Commit

Permalink
fix CMAKE_C_SIMULATE_ID
Browse files Browse the repository at this point in the history
  • Loading branch information
christianrauch committed Jan 21, 2024
1 parent ed0e640 commit ae20ab3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ae20ab3

Please sign in to comment.