<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:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@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:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
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:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle19
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle20
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle21
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle22
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle23
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle24
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle25
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:363217114;
mso-list-type:hybrid;
mso-list-template-ids:533867854 1284548252 269025283 269025285 269025281 269025283 269025285 269025281 269025283 269025285;}
@list l0:level1
{mso-level-start-at:0;
mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l1
{mso-list-id:463886640;
mso-list-type:hybrid;
mso-list-template-ids:-1730659340 269025291 269025283 269025285 269025281 269025283 269025285 269025281 269025283 269025285;}
@list l1:level1
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l1:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l1:level3
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l1:level4
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l1:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l1:level6
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l1:level7
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l1:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l1:level9
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l2
{mso-list-id:1545022538;
mso-list-template-ids:-1397195554;}
@list l2:level1
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l2:level2
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:72.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l2:level3
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:108.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l2:level4
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:144.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l2:level5
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:180.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l2:level6
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:216.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l2:level7
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:252.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l2:level8
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:288.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l2:level9
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:324.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l3
{mso-list-id:1908223406;
mso-list-template-ids:1708156932;}
@list l3:level1
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l3:level2
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:72.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l3:level3
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:108.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l3:level4
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:144.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l3:level5
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:180.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l3:level6
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:216.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l3:level7
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:252.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l3:level8
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:288.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l3:level9
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:324.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></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="EN-CA" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">It is technically possibly to integrate ninja into Visual Studio, through the NMake bindings. We’re doing it with Fastbuild:<br>
<br>
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:8.0pt;font-family:"Courier New";mso-fareast-language:EN-US"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='x64-Debug|x64'"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:8.0pt;font-family:"Courier New";mso-fareast-language:EN-US"> <NMakeBuildCommandLine>cd $(SolutionDir)\..\..\Code\ & ..\Bin\Windows-x64\fbuild -vs -dist -monitor -fastcancel -cache
$(ProjectName)-$(Configuration)</NMakeBuildCommandLine><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:8.0pt;font-family:"Courier New";mso-fareast-language:EN-US"> <NMakeReBuildCommandLine>cd $(SolutionDir)\..\..\Code\ & ..\Bin\Windows-x64\fbuild -vs -dist -monitor -fastcancel -cache
-clean $(ProjectName)-$(Configuration)</NMakeReBuildCommandLine><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:8.0pt;font-family:"Courier New";mso-fareast-language:EN-US"> <NMakePreprocessorDefinitions>WIN32_LEAN_AND_MEAN;WIN32;_WIN32;__WINDOWS__;WIN64;DEBUG;PROFILING_ENABLED;</NMakePreprocessorDefinitions><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:8.0pt;font-family:"Courier New";mso-fareast-language:EN-US"> <NMakeIncludeSearchPath>..\..\..\Code\;..\..\..\External\SDK\VisualStudio\2017\Professional\VC\Tools\MSVC\14.16.27023\include\;..\..\..\External\SDK\Windows\10\Include\10.0.17763.0\ucrt;..\..\..\External\SDK\Windows\10\Include\10.0.17763.0\um;..\..\..\External\SDK\Windows\10\Include\10.0.17763.0\shared;</NMakeIncludeSearchPath><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:8.0pt;font-family:"Courier New";mso-fareast-language:EN-US"> <IntDir>$(SolutionDir)\Temp</IntDir><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:8.0pt;font-family:"Courier New";mso-fareast-language:EN-US"> <OutDir>$(SolutionDir)\Temp</OutDir><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:8.0pt;font-family:"Courier New";mso-fareast-language:EN-US"> </PropertyGroup><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">In this case, we generate both .vcxprojs with NMake properties, and Fastbuild .bff files (which are the equivalent to .vcxprojs). NMake invokes Fastbuild instead of using MSBuild.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">I am not aware though how/if `cmake` can do that, I don’t think it supports this kind of scenario. You’d have to generate once the .sln/.vcxprojs and then invoke `cmake` again with -GNinja, and hope
that the former properly invokes the latter. It is possible, but someone would have to make that work.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">I find it easier to build and use them separately. I keep Visual Studio open to browse and edit LLVM files/projects, and use cmd-line `ninja` in various configurations. You can actually use the VS
debugger, however you need to manually change the paths to use the ninja-built EXEs (on the “Debugging” property page).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>De :</b> Chris Tetreault <ctetreau@quicinc.com> <br>
<b>Envoyé :</b> April 13, 2020 12:40 PM<br>
<b>À :</b> Alexandre Ganea <alexandre.ganea@ubisoft.com>; Sudhindra kulkarni <sudhindrakkulkarni102@gmail.com><br>
<b>Cc :</b> LLVM Dev <llvm-dev@lists.llvm.org><br>
<b>Objet :</b> RE: [llvm-dev] Running clang tests<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">Interesting. I’ve always heard that “Ninja is faster” but never seen actual numbers before, so I appreciate you taking the time to post them. That said, ~10 extra minutes with cl.exe/msbuild for a full rebuild is a price
that I personally am willing to pay to be able to use the visual studio debugger.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Hopefully you get /MP support for clang-cl soon. Visual Studio is my preferred development environment for C++, so anything that makes that situation better with open source tools is a win in my book.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Alexandre Ganea <</span><a href="mailto:alexandre.ganea@ubisoft.com"><span lang="EN-US">alexandre.ganea@ubisoft.com</span></a><span lang="EN-US">>
<br>
<b>Sent:</b> Friday, April 10, 2020 4:05 PM<br>
<b>To:</b> Alexandre Ganea <</span><a href="mailto:alexandre.ganea@ubisoft.com"><span lang="EN-US">alexandre.ganea@ubisoft.com</span></a><span lang="EN-US">>; Chris Tetreault <</span><a href="mailto:ctetreau@quicinc.com"><span lang="EN-US">ctetreau@quicinc.com</span></a><span lang="EN-US">>;
Sudhindra kulkarni <</span><a href="mailto:sudhindrakkulkarni102@gmail.com"><span lang="EN-US">sudhindrakkulkarni102@gmail.com</span></a><span lang="EN-US">><br>
<b>Subject:</b> [EXT] RE: [llvm-dev] Running clang tests<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal">Even when using cl.exe there’s a significant difference between MSBuild and Ninja, as you can see in the figures in the review.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>De :</b> llvm-dev <<a href="mailto:llvm-dev-bounces@lists.llvm.org">llvm-dev-bounces@lists.llvm.org</a>>
<b>De la part de</b> Alexandre Ganea via llvm-dev<br>
<b>Envoyé :</b> April 10, 2020 6:47 PM<br>
<b>À :</b> Chris Tetreault <<a href="mailto:ctetreau@quicinc.com">ctetreau@quicinc.com</a>>; Sudhindra kulkarni <<a href="mailto:sudhindrakkulkarni102@gmail.com">sudhindrakkulkarni102@gmail.com</a>><br>
<b>Cc :</b> LLVM Dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
<b>Objet :</b> Re: [llvm-dev] Running clang tests<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Chris,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">We are fixing the issues :-) clang-cl doesn’t currently support /MP which makes building of each project single-threaded with MSBuild. I have a patch ongoing here:
<a href="https://reviews.llvm.org/D52193">https://reviews.llvm.org/D52193</a> – I am working on it since last week to iron out the last issues, I’ll update it soon.<o:p></o:p></p>
<p class="MsoNormal">Without that you have to resort to increasing the “maximum number of parallel builds” to a higher value than the default 2.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>De :</b> Chris Tetreault <<a href="mailto:ctetreau@quicinc.com">ctetreau@quicinc.com</a>>
<br>
<b>Envoyé :</b> April 10, 2020 6:36 PM<br>
<b>À :</b> Alexandre Ganea <<a href="mailto:alexandre.ganea@ubisoft.com">alexandre.ganea@ubisoft.com</a>>; Sudhindra kulkarni <<a href="mailto:sudhindrakkulkarni102@gmail.com">sudhindrakkulkarni102@gmail.com</a>><br>
<b>Cc :</b> LLVM Dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
<b>Objet :</b> RE: [llvm-dev] Running clang tests<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> I’d just like to interject to say that building within Visual Studio isn’t really that bad. Running the lit tests is a bit painful because the LLVM build tools that are integrated with the build system don’t play nice
with msbuild. Particularly, I’ve never been able to actually cancel an invocation of lit or tablegen via visual studio. That said, there is a huge upside to building with Visual Studio: actually being able to use the debugger.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> Honestly, I find this “just use ninja” attitude frustrating and troubling. If there are pain points with using MSVC or make or whatever, we should be trying to fix then, not just throwing our hands up in the air giving
up. In my opinion, most of the issues surrounding using make or msbuild stem from the fact that nobody is using these build systems, so nobody is fixing the issues. I feel that we should be encouraging people to use the build system that they prefer, and encouraging
people to fix the build system to work well with their chosen build system. This is the only way that things will get better.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> Sudhindra, to answer your question, I would also recommend upgrading to Visual Studio 2019 if you can. I just tried to directly run ASTMatcherTests from Visual Studio 2019 and it worked for me. I have no experience
with the GTest IDE plugin, I’ve always just ran GTest binaries directly. There’s also a check-clang (I think that’s the one you want. It might be called something else but it’s definitely there) target in there that is equivalent to the Ninja check-clang target.
These check targets are weird because to run them you have to do “build” from Visual Studio. If you try to actually run the target it won’t work. This is one of those things that would probably get fixed if people actually used the LLVM Visual Studio project.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> Christopher Tetreault<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> llvm-dev <</span><a href="mailto:llvm-dev-bounces@lists.llvm.org"><span lang="EN-US">llvm-dev-bounces@lists.llvm.org</span></a><span lang="EN-US">>
<b>On Behalf Of </b>Alexandre Ganea via llvm-dev<br>
<b>Sent:</b> Friday, April 10, 2020 1:35 PM<br>
<b>To:</b> Sudhindra kulkarni <</span><a href="mailto:sudhindrakkulkarni102@gmail.com"><span lang="EN-US">sudhindrakkulkarni102@gmail.com</span></a><span lang="EN-US">>; LLVM Dev <</span><a href="mailto:llvm-dev@lists.llvm.org"><span lang="EN-US">llvm-dev@lists.llvm.org</span></a><span lang="EN-US">><br>
<b>Subject:</b> [EXT] Re: [llvm-dev] Running clang tests<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal">Hi,<br>
<br>
LLVM requires Visual Studio 2017 or 2019: <a href="https://llvm.org/docs/GettingStartedVS.html#software">
https://llvm.org/docs/GettingStartedVS.html#software</a> – you could use Community 2019.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I don’t recommend building LLVM inside Visual Studio. However you can generate or update the VS solution once in a while:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<ul style="margin-top:0cm" type="disc">
<li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo3">mkdir buildVS && cd buildVS<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo3">cmake {your_llvm_root}/llvm -G"Visual Studio 16 2019" -Thost=x64 -DLLVM_ENABLE_PROJECTS=clang;llvm -DLLVM_OPTIMIZED_TABLEGEN=ON<o:p></o:p></li></ul>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Use Ninja instead for building: <a href="https://ninja-build.org/">
https://ninja-build.org/</a> it’s a lot faster - keep Visual Studio only for debugging.<o:p></o:p></p>
<p class="MsoNormal">Ensure ninja.exe is in %PATH%.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">From a Visual Studio shell (“x64 Native Tools Command Prompt for VS 2019” in the Start menu) run the following:<o:p></o:p></p>
<ul style="margin-top:0cm" type="disc">
<li class="MsoListParagraph" style="margin-left:0cm;mso-list:l1 level1 lfo6">mkdir buildNinjaRel && cd buildNinjaRel<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:0cm;mso-list:l1 level1 lfo6">cmake {your_llvm_root}/llvm -G"Ninja" -DLLVM_ENABLE_PROJECTS=clang;llvm -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLLVM_OPTIMIZED_TABLEGEN=ON<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:0cm;mso-list:l1 level1 lfo6">ninja check-all<o:p></o:p></li></ul>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">You can then debug the test in VS: {your_llvm_root}\buildNinjaRel\tools\clang\unittests\ASTMatchers\ASTMatchersTests.exe<o:p></o:p></p>
<div style="border:none;border-bottom:solid windowtext 1.0pt;padding:0cm 0cm 1.0pt 0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
Then re-run “ninja check-clang-unit” or just “ninja” if you want to iterate on code changes.<br>
<br>
<span lang="FR-CA">Best,<br>
Alex.<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="FR-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="FR">De :</span></b><span lang="FR"> llvm-dev <</span><a href="mailto:llvm-dev-bounces@lists.llvm.org"><span lang="FR">llvm-dev-bounces@lists.llvm.org</span></a><span lang="FR">>
<b>De la part de</b> Sudhindra kulkarni via llvm-dev<br>
<b>Envoyé :</b> April 10, 2020 6:42 AM<br>
<b>À :</b> </span><a href="mailto:llvm-dev@lists.llvm.org"><span lang="FR">llvm-dev@lists.llvm.org</span></a><span lang="FR"><br>
<b>Objet :</b> [llvm-dev] Running clang tests<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR-CA"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal">Hi Team,<o:p></o:p></p>
<div>
<p class="MsoNormal"> I have checked out the clang and llvm source code and built the executables using the visual studio 2015 community edition. I am using Windows as my platform.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">However I see that there are some test cases under the clang test folder in the LLVM.sln. Eg AstMatcherTest,ASTTests etc. I see that these tests make use of the Google test framework. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">In my visual studio I have installed Google Test Adapter extension for running the Google tests.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">But the tests under <span style="font-family:"Arial",sans-serif">AstMatcherTest,ASTTests projects won't show up in the Test Explorer view in visual studio even after building these projects.So I wanted to know the reason for the same. </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif">So can you please let me know if it possible to run these tests in visual studio. If not how to run them.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif">Thanks in advance.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif">Thanks and Regards </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif">Sudhindra Kulkarni </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</body>
</html>