<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle19
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FR-CA" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-CA" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Yes you’re right, -DLLVM_USE_CRT_RELEASE=MT</span><span lang="EN-CA" style="font-size:11.0pt;font-family:"Calibri",sans-serif">
</span><span lang="EN-CA" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">works indeed! Although the “Visual Studio” cmake generators are multi-config, so you end up with -DCMAKE_BUILD_TYPE=Release  being ignored,
 which means that if you want to make things right, you would need to also set the other –DLLVM_USE_CRT_XXX values as well, to avoid surprises when switching targets inside VS. For those multi-config generators, reintroducing -DLLVM_USE_CRT would be nice, maybe.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="FR" style="font-size:11.0pt;font-family:"Calibri",sans-serif">De :</span></b><span lang="FR" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Reid Kleckner <rnk@google.com>
<br>
<b>Envoyé :</b> October 28, 2019 4:13 PM<br>
<b>À :</b> Alexandre Ganea <alexandre.ganea@ubisoft.com><br>
<b>Cc :</b> Osman Zakir <osmanzakir90@hotmail.com>; llvm-dev <llvm-dev@lists.llvm.org><br>
<b>Objet :</b> Re: [llvm-dev] How to Switch to Static Runtime and Enable C++ Exceptions?<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<p class="MsoNormal">On Mon, Oct 28, 2019 at 5:11 AM Alexandre Ganea via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<p class="MsoNormal">You can’t enable the static CRT through the command-line. You would need to apply this patch:
<a href="https://reviews.llvm.org/D55056" target="_blank">https://reviews.llvm.org/D55056</a><br>
(although it doesn’t work with lldb)<o:p></o:p></p>
</div>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">Are you sure? I would expect `cmake -DLLVM_USE_CRT_RELEASE=MT` to use the static CRT.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal">I think Zach is correct, Osman can use -DLLVM_ENABLE_EH=ON, and it will enable exceptions.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">You're still getting a warning from the benchmark library because LLVM's cmake forcibly disables benchmark library exceptions here:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="https://github.com/llvm/llvm-project/blob/2724d9e/llvm/CMakeLists.txt#L1094">https://github.com/llvm/llvm-project/blob/2724d9e/llvm/CMakeLists.txt#L1094</a> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">That's probably a bug, it should probably be dependent on LLVM_ENABLE_EH.<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>