Commit 15878ee4 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Windows, compiling : Remove _DEBUG preprocessor constant, to fix

debug build with older cmake.

The constant is implicitely defined by VS when chosen C runtime is Debug
(/MTd, MDd).

CMake does not define it since https://public.kitware.com/Bug/view.php?id=15777
was fixed.

We remove it from compile flags, to be able to build Debug with /MT runtime
using older cmakes.
parent fb0b3640
......@@ -97,6 +97,10 @@ IF(MSVC)
# information for use with the debugger. The symbolic debugging
# information includes the names and types of variables, as well as
# functions and line numbers. No .pdb file is produced by the compiler.
#
# - Remove preprocessor flag _DEBUG that older cmakes use with Config=Debug,
# it is as defined by Debug runtimes itself (/MTd /MDd)
FOREACH(lang C CXX)
SET(CMAKE_${lang}_FLAGS_RELEASE "${CMAKE_${lang}_FLAGS_RELEASE} /Z7")
ENDFOREACH()
......@@ -106,6 +110,7 @@ IF(MSVC)
CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG_INIT)
STRING(REGEX REPLACE "/M[TD][d]?" "${MSVC_CRT_TYPE}" "${flag}" "${${flag}}" )
STRING(REGEX REPLACE "/D[ ]?_DEBUG" "" "${flag}" "${${flag}}")
STRING(REPLACE "/Zi" "/Z7" "${flag}" "${${flag}}")
ENDFOREACH()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment