<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Tue, Jul 21, 2015 at 6:58 PM Justin Bogner <<a href="mailto:mail@justinbogner.com">mail@justinbogner.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Paweł Bylica <<a href="mailto:chfast@gmail.com" target="_blank">chfast@gmail.com</a>> writes:<br>
> On Tue, Jul 21, 2015 at 6:30 PM Justin Bogner <<a href="mailto:mail@justinbogner.com" target="_blank">mail@justinbogner.com</a>> wrote:<br>
>> Paweł Bylica <<a href="mailto:chfast@gmail.com" target="_blank">chfast@gmail.com</a>> writes:<br>
>>> On Tue, Jul 21, 2015 at 5:55 PM Justin Bogner <<a href="mailto:mail@justinbogner.com" target="_blank">mail@justinbogner.com</a>> wrote:<br>
>>>> FWIW, `llvm-config --assertion-mode` will tell you whether or not your<br>
>>>> LLVM was built with or without NDEBUG.<br>
>>><br>
>>> That's not true in all cases. In case CMAKE_BUILD_TYPE=Release,<br>
>>> LLVM_ENABLE_ASSERTIONS=Off and CMAKE_CXX_FLAGS_RELEASE=""<br>
>>> llvm-config reports asserts as off but NDEBUG flag is not set.<br>
>><br>
>> Um, okay, but why would you set CMAKE_CXX_FLAGS_RELEASE=""? That<br>
>> doesn't make any sense...<br>
><br>
> I agree, it make no sense. But homebrew actually does that:<br>
> <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_Homebrew_homebrew_blob_master_Library_Homebrew_formula.rb-23L615&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=Yp3mo8OBkOG9RFau6Vyks7hT-pBXIrNw3Gm9mUPKFvM&s=BGvdBqMqce0tPOv75y1ZfZ2mWHYcSxMkoD37K4Nap1Q&e=" rel="noreferrer" target="_blank">https://github.com/Homebrew/homebrew/blob/master/Library/Homebrew/formula.rb#L615</a><br>
<br>
That sounds very broken - maybe ask them to fix it?<br></blockquote><div><br></div><div>I've fixed that for the LLVM formula.</div><div><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_Homebrew_homebrew_blob_master_Library_Formula_llvm.rb-23L140&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=Yp3mo8OBkOG9RFau6Vyks7hT-pBXIrNw3Gm9mUPKFvM&s=CHnenN0nssBdGje3IF4Le35SiTs3V-1IPWqReKS7_DU&e=">https://github.com/Homebrew/homebrew/blob/master/Library/Formula/llvm.rb#L140</a></div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
In any case, `llvm-config` seems to correctly report asserts as ON in<br>
this case, despite the configuration being completely bogus:<br></blockquote><div><br></div><div>In the same time the shared cmake file LLVMConfig.cmake will have LLVM_ENABLE_ASSERTIONS set to On.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
  % cmake -G Ninja ../llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=Off -DCMAKE_CXX_FLAGS_RELEASE=""<br>
  ...<br>
  % ninja llvm-config<br>
  [94/94] Linking CXX executable bin/llvm-config<br>
   % ./bin/llvm-config --assertion-mode<br>
  ON<br>
<br>
The code that prints this just checks NDEBUG:<br>
<br>
llvm-config.cpp:320:<br>
>       } else if (Arg == "--assertion-mode") {<br>
> #if defined(NDEBUG)<br>
>         OS << "OFF\n";<br>
> #else<br>
>         OS << "ON\n";<br>
> #endif<br>
</blockquote></div></div>