From 004ee0b78577ffbc4425e204ac6fba0622c80dc1 Mon Sep 17 00:00:00 2001 From: Vladimir Timofeev Date: Mon, 26 Jan 2015 15:29:03 +0300 Subject: [PATCH] cmake+msvc: Use inline debug info (/Z7) format. Or internal error may occur because some dependant libs compiled with Z7 format. --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 69bc337a7149..f59bbec13f9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,6 +87,14 @@ if(MSVC) ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -wd4251 -wd4244 -wd4334 -wd4005 -wd4820 -wd4710 -wd4514 -wd4056 -wd4996 -wd4099) + + # Use inline debug info (/Z7) format. Or internal error may occur. + # Errors looks like: "xmemory0(592): error C3130: Internal Compiler Error: failed to write injected code block to PDB" + foreach(lang C CXX) + string(REGEX REPLACE "/Z[iI7]" "" CMAKE_${lang}_FLAGS_DEBUG "${CMAKE_${lang}_FLAGS_DEBUG}") + set(CMAKE_${lang}_FLAGS_DEBUG "${CMAKE_${lang}_FLAGS_DEBUG} /Z7") + endforeach() + else() set(CMAKE_C_FLAGS_DEBUG "-g -Wall -DCOCOS2D_DEBUG=1") set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})