Skip to content

Commit

Permalink
Ensure MSVC compiler flags use matching runtime library to liboqs
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Bruce committed May 16, 2024
1 parent 65f0e75 commit d712409
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 "")
Expand Down

0 comments on commit d712409

Please sign in to comment.