Skip to content

Commit

Permalink
Only allow STATIC_CRT in case of a STATIC build. (#17)
Browse files Browse the repository at this point in the history
STATIC_CRT changes the default /MD[d] option into /MT[d].

Building a library using /MT[d] without static linking may result in a
heap corruption.

Fixes #13
  • Loading branch information
m7913d authored Aug 25, 2024
1 parent a8d1c32 commit 5055ba0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ option(DOCUMENTATION "Set to ON to build API reference documentation (in ./api-r

# Platform specific options
if(MSVC)
option(STATIC_CRT "Link with the static version of MSVCRT (/MD[d])" OFF)
option(STATIC_CRT "Link with the static version of MSVCRT (/MT[d])" OFF)

if (STATIC_CRT AND NOT STATIC)
message( FATAL_ERROR "STATIC_CRT is only supported for STATIC builds." )
endif()
else()
option(COVERAGE "Generate coverage data using gcov" OFF)
endif()
Expand Down

0 comments on commit 5055ba0

Please sign in to comment.