From ea9f40975add631f0eb62daa9e8599b1765e5322 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Sun, 6 Apr 2025 10:02:39 +0800 Subject: [PATCH] cmake: fix build warnings on windows --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 817bd0c3b1..bd7af42838 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,10 @@ function(boost_test_add_library name) # PRIVATE BOOST_TEST_SOURCE ) + if(WIN32) + target_compile_definitions(boost_${name} PRIVATE _CRT_SECURE_NO_WARNINGS) + endif() + if(BUILD_SHARED_LIBS) target_compile_definitions(boost_${name} PUBLIC BOOST_TEST_DYN_LINK) else()