<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Sep 20, 2013, at 11:16 AM, Tilmann Scheller <<a href="mailto:tscheller@apple.com">tscheller@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Sep 20, 2013, at 8:07 PM, Pete Cooper <<a href="mailto:peter_cooper@apple.com">peter_cooper@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div><br class="Apple-interchange-newline">On Sep 20, 2013, at 10:56 AM, Tilmann Scheller <<a href="mailto:tscheller@apple.com">tscheller@apple.com</a>> wrote:</div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">I ran into a similar issue yesterday, I was wondering why an assert wouldn’t trigger. Looking at the disassembly I realized that the code for the assert was actually not there even though I was building with CMAKE_BUILD_TYPE=Debug. How could that happen?<div><br></div><div>Turns out when I did the initial configure of my build directory I forgot to set CMAKE_BUILD_TYPE, so once I realized I couldn’t debug my binary I did a CMAKE_BUILD_TYPE=Debug. After that debugging works fine again, however asserts are still turned off!<br></div></div></blockquote>Strange.  The LLVM cmake documentation implies that debug should have enabled asserts, that is it says that:</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">"<strong style="font-family: 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; font-size: 14px; line-height: 21px;">LLVM_ENABLE_ASSERTIONS</strong><span style="background-color: rgb(255, 255, 255); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; font-size: 14px; line-height: 21px;">:BOOL</span><dd style="margin-top: 3px; margin-bottom: 10px; margin-left: 30px; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; font-size: 14px; line-height: 21px; background-color: rgb(255, 255, 255); position: static; z-index: auto;">Enables code assertions. Defaults to OFF if and only if <tt class="docutils literal" style="font-family: Consolas, 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace; font-size: 0.95em;">CMAKE_BUILD_TYPE</tt> is <em>Release</em>.</dd></div></blockquote></div>If I do the initial configure of my build directory specifying CMAKE_BUILD_TYPE=Debug then asserts get turned on just fine. Only seems to break when I switch to a Debug build type from a build type which has assertions disabled.</div></blockquote>Ah.  I didn’t realize that was how CMake behaved.  So the above snippet of documentation is really only for the initial configure, not later ones.</div><div><br></div><div>Makes sense I guess.</div><div><br></div><div>Thanks,</div><div>Pete<br><blockquote type="cite" dir="auto"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><br></div><div>Regards,</div><div><br></div><div>Tilmann</div><div><br></div></div></blockquote></div><br></body></html>