I tested the mentioned change for debuginfo format from /Zi to /Z7, and it seems to work well. The noticable change is that static libraries will be bigger in size (this of course applies to the libraries themselves, not to programs they link to). So I conclude, if the size of embedded library = 300M does not bother too many people, /Z7 should be quite ok. The whole patch is below.
=== modified file 'cmake/os/Windows.cmake'
|
--- cmake/os/Windows.cmake 2011-06-30 15:46:53 +0000
|
+++ cmake/os/Windows.cmake 2014-04-04 06:02:17 +0000
|
@@ -71,13 +71,15 @@
|
SET(CMAKE_{type}_LINKER_FLAGS_RELEASE "${CMAKE_${type}_LINKER_FLAGS_RELEASE} /debug")
|
ENDFOREACH()
|
|
- # Force static runtime libraries
|
+ # Force static runtime libraries.
|
+ # Force /Z7 instead of default /Zi to have debug symbols in static libraries.
|
FOREACH(flag
|
CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO
|
CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG_INIT
|
CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG_INIT)
|
STRING(REPLACE "/MD" "/MT" "${flag}" "${${flag}}")
|
+ STRING(REPLACE "/Zi" "/Z7" "${flag}" "${${flag}}")
|
ENDFOREACH()
|
|
# Remove support for exceptions
|
The attached workaround was suggested by Wlad. He also had additional thoughts on the subject, I hope he will comment with those.
Meanwhile, here is a free translation of his notes: