From d7124095cc2e9fb771de3d5b2b99af4224b2a65e Mon Sep 17 00:00:00 2001 From: Andy Bruce Date: Thu, 16 May 2024 09:23:18 -0400 Subject: [PATCH] Ensure MSVC compiler flags use matching runtime library to liboqs --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 05b2fa30..d46a7a86 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,11 +15,15 @@ else() endif() if(MSVC) - set(CMAKE_EXE_LINKER_FLAGS - "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:LIBCMT") + # ABr: do not suppress warnings on library mismatch; instead, fix them :) + #set(CMAKE_EXE_LINKER_FLAGS + # "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:LIBCMT") add_definitions(-DOQS_PROVIDER_NOATOMIC) add_definitions(-D_CRT_SECURE_NO_WARNINGS) set(OQS_ADDL_SOCKET_LIBS ws2_32.lib gdi32.lib crypt32.lib) + # ABr: using /MT needs to depend on Debug vs Release and must match liboqs / openssl + set(CMAKE_CXX_FLAGS_RELEASE "/MT") + set(CMAKE_CXX_FLAGS_DEBUG "/MTd") else() add_compile_options(-Wunused-function) set(OQS_ADDL_SOCKET_LIBS "")