Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f587f38

Browse files
mstrapEdward Thomson
authored and
Edward Thomson
committed
CMake: do not overwrite but only append to CMAKE_C_FLAGS_DEBUG
This is useful to force "smart" IDEs (like CLIon) to use debug flag -g even it may have decided that "-D_DEBUG" (which is already present) is sufficient.
1 parent cdde081 commit f587f38

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ IF (MSVC)
412412
# /MTd - Statically link the multithreaded debug version of the CRT
413413
# /MDd - Dynamically link the multithreaded debug version of the CRT
414414
# /RTC1 - Run time checks
415-
SET(CMAKE_C_FLAGS_DEBUG "/Zi /Od /D_DEBUG /RTC1 ${CRT_FLAG_DEBUG}")
415+
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Zi /Od /D_DEBUG /RTC1 ${CRT_FLAG_DEBUG}")
416416

417417
# /DNDEBUG - Disables asserts
418418
# /MT - Statically link the multithreaded release version of the CRT
@@ -464,7 +464,7 @@ ELSE ()
464464
ENDIF()
465465

466466
IF (WIN32 AND NOT CYGWIN)
467-
SET(CMAKE_C_FLAGS_DEBUG "-D_DEBUG")
467+
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG")
468468
ENDIF ()
469469

470470
IF (MINGW) # MinGW always does PIC and complains if we tell it to

0 commit comments

Comments
 (0)