From 49af9d0a6f2bf6c7f5cc7531921443499149c4c4 Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Sun, 21 Jan 2024 16:00:15 +0100 Subject: [PATCH] ignore strdup warnings --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 555cb14f..79cee529 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,6 +48,12 @@ 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") + # 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) +endif() + aux_source_directory(common COMMON_SRC) set(APRILTAG_SRCS apriltag.c apriltag_pose.c apriltag_quad_thresh.c)