Only force multiple when build in Debug

Debug only, required for reliable '_xxxx_dbg' CRT allocator function overrides.
This commit is contained in:
Kawe Mazidjatari 2023-06-30 22:02:27 +02:00
parent bfd2f48cc0
commit 894eea12de
2 changed files with 12 additions and 2 deletions

View File

@ -124,6 +124,16 @@ endif()
target_link_options( ${PROJECT_NAME} PRIVATE target_link_options( ${PROJECT_NAME} PRIVATE
"/STACK:8000000" # Match game executable stack reserve size "/STACK:8000000" # Match game executable stack reserve size
# The only reason this has to be done, is because
# the _xxxx_dbg malloc functions could otherwise
# throw a linker error, as they are already defined
# in the CRT library, but there doesn't seem to be
# a standard way to override these, unlike the
# _xxxx_base malloc functions. Since this is only
# relevant for debug builds, this linker flag should
# only be toggled for DEBUG!!!
$<$<CONFIG:Debug>:/FORCE:MULTIPLE>
) )
add_custom_command( TARGET ${PROJECT_NAME} POST_BUILD add_custom_command( TARGET ${PROJECT_NAME} POST_BUILD

View File

@ -37,6 +37,6 @@ target_link_options( ${PROJECT_NAME} PRIVATE
# a standard way to override these, unlike the # a standard way to override these, unlike the
# _xxxx_base malloc functions. Since this is only # _xxxx_base malloc functions. Since this is only
# relevant for debug builds, this linker flag should # relevant for debug builds, this linker flag should
# only be toggled for DEBUG builds!!! # only be toggled for DEBUG!!!
"/FORCE:MULTIPLE" $<$<CONFIG:Debug>:/FORCE:MULTIPLE>
) )