From 0ca9fca86900f1663606a4e9b2cb49256599108c Mon Sep 17 00:00:00 2001 From: Eidolon Date: Thu, 14 Dec 2023 23:27:44 -0600 Subject: [PATCH] Pass _CRT_SECURE_NO_WARNINGS on MSVC --- src/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c139d5d64..7c4d89203 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -417,6 +417,11 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") target_compile_options(SRB2SDL2 PRIVATE -mno-ms-bitfields) endif() +# Yes we know we use insecure CRT functions... +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + target_compile_definitions(SRB2SDL2 PRIVATE -D_CRT_SECURE_NO_WARNINGS) +endif() + # Compiler warnings configuration target_compile_options(SRB2SDL2 PRIVATE # Using generator expressions to handle per-language compile options