I'm trying to compile WebRTC, but because we use a number of libraries, some of which are closed source and beyond our control, how it gets compiled is rather sensitive to match. I've already had to edit the build/config/win/BUILD.gn
script to use /MDd
and /MD
build flags instead of /MTd
and /MT
respectively, as we use the multi-threaded DLL runtime. To build, we run
gn gen out/Debug --args="is_debug=true is_clang=false use_lld=false visual_studio_version=2019"
ninja -C out/Debug
However, when linking against webrtc.lib, it fails with multiple errors citing a mismatch between _ITERATOR_DEBUG_LEVEL
. I've seen this error plenty, it happens when linking a release-built library (_ITERATOR_DEBUG_LEVEL=2
) with a debug executable (_ITERATOR_DEBUG_LEVEL=0
). However that's clearly not how I've compiled it. I've tried adding /DEBUG
(which should be implied by /MDd
as far as I know) but it produces an identical library with the same issue. I've confirmed checking the generated .ninja scripts that these arguments are in the cflags
.
Is there a way to get ninja to properly observe the debug flags?