Hi,
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.
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.
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.
Thanks,
Christopher Tetreault
From: llvm-dev <llvm-dev-bounces at lists.llvm.org> On Behalf Of Alexandre
Ganea via llvm-dev
Sent: Friday, April 10, 2020 1:35 PM
To: Sudhindra kulkarni <sudhindrakkulkarni102 at gmail.com>; LLVM Dev
<llvm-dev at lists.llvm.org>
Subject: [EXT] Re: [llvm-dev] Running clang tests
Hi,
LLVM requires Visual Studio 2017 or 2019:
https://llvm.org/docs/GettingStartedVS.html#software – you could use Community
2019.
I don’t recommend building LLVM inside Visual Studio. However you can generate
or update the VS solution once in a while:
* mkdir buildVS && cd buildVS
* cmake {your_llvm_root}/llvm -G"Visual Studio 16 2019" -Thost=x64
-DLLVM_ENABLE_PROJECTS=clang;llvm -DLLVM_OPTIMIZED_TABLEGEN=ON
Use Ninja instead for building: https://ninja-build.org/ it’s a lot faster -
keep Visual Studio only for debugging.
Ensure ninja.exe is in %PATH%.
From a Visual Studio shell (“x64 Native Tools Command Prompt for VS 2019” in the
Start menu) run the following:
* mkdir buildNinjaRel && cd buildNinjaRel
* cmake {your_llvm_root}/llvm -G"Ninja"
-DLLVM_ENABLE_PROJECTS=clang;llvm -DCMAKE_BUILD_TYPE=RelWithDebInfo
-DLLVM_OPTIMIZED_TABLEGEN=ON
* ninja check-all
You can then debug the test in VS:
{your_llvm_root}\buildNinjaRel\tools\clang\unittests\ASTMatchers\ASTMatchersTests.exe
Then re-run “ninja check-clang-unit” or just “ninja” if you want to iterate on
code changes.
Best,
Alex.
De : llvm-dev <llvm-dev-bounces at lists.llvm.org<mailto:llvm-dev-bounces
at lists.llvm.org>> De la part de Sudhindra kulkarni via llvm-dev
Envoyé : April 10, 2020 6:42 AM
À : llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>
Objet : [llvm-dev] Running clang tests
Hi Team,
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.
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.
In my visual studio I have installed Google Test Adapter extension for running
the Google tests.
But the tests under 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.
So can you please let me know if it possible to run these tests in visual
studio. If not how to run them.
Thanks in advance.
Thanks and Regards
Sudhindra Kulkarni
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20200410/f8c397fb/attachment.html>
Chris,
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: https://reviews.llvm.org/D52193 – I am working on it since last week to
iron out the last issues, I’ll update it soon.
Without that you have to resort to increasing the “maximum number of parallel
builds” to a higher value than the default 2.
De : Chris Tetreault <ctetreau at quicinc.com>
Envoyé : April 10, 2020 6:36 PM
À : Alexandre Ganea <alexandre.ganea at ubisoft.com>; Sudhindra kulkarni
<sudhindrakkulkarni102 at gmail.com>
Cc : LLVM Dev <llvm-dev at lists.llvm.org>
Objet : RE: [llvm-dev] Running clang tests
Hi,
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.
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.
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.
Thanks,
Christopher Tetreault
From: llvm-dev <llvm-dev-bounces at lists.llvm.org<mailto:llvm-dev-bounces
at lists.llvm.org>> On Behalf Of Alexandre Ganea via llvm-dev
Sent: Friday, April 10, 2020 1:35 PM
To: Sudhindra kulkarni <sudhindrakkulkarni102 at
gmail.com<mailto:sudhindrakkulkarni102 at gmail.com>>; LLVM Dev
<llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>>
Subject: [EXT] Re: [llvm-dev] Running clang tests
Hi,
LLVM requires Visual Studio 2017 or 2019:
https://llvm.org/docs/GettingStartedVS.html#software – you could use Community
2019.
I don’t recommend building LLVM inside Visual Studio. However you can generate
or update the VS solution once in a while:
* mkdir buildVS && cd buildVS
* cmake {your_llvm_root}/llvm -G"Visual Studio 16 2019" -Thost=x64
-DLLVM_ENABLE_PROJECTS=clang;llvm -DLLVM_OPTIMIZED_TABLEGEN=ON
Use Ninja instead for building: https://ninja-build.org/ it’s a lot faster -
keep Visual Studio only for debugging.
Ensure ninja.exe is in %PATH%.
From a Visual Studio shell (“x64 Native Tools Command Prompt for VS 2019” in the
Start menu) run the following:
* mkdir buildNinjaRel && cd buildNinjaRel
* cmake {your_llvm_root}/llvm -G"Ninja"
-DLLVM_ENABLE_PROJECTS=clang;llvm -DCMAKE_BUILD_TYPE=RelWithDebInfo
-DLLVM_OPTIMIZED_TABLEGEN=ON
* ninja check-all
You can then debug the test in VS:
{your_llvm_root}\buildNinjaRel\tools\clang\unittests\ASTMatchers\ASTMatchersTests.exe
Then re-run “ninja check-clang-unit” or just “ninja” if you want to iterate on
code changes.
Best,
Alex.
De : llvm-dev <llvm-dev-bounces at lists.llvm.org<mailto:llvm-dev-bounces
at lists.llvm.org>> De la part de Sudhindra kulkarni via llvm-dev
Envoyé : April 10, 2020 6:42 AM
À : llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>
Objet : [llvm-dev] Running clang tests
Hi Team,
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.
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.
In my visual studio I have installed Google Test Adapter extension for running
the Google tests.
But the tests under 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.
So can you please let me know if it possible to run these tests in visual
studio. If not how to run them.
Thanks in advance.
Thanks and Regards
Sudhindra Kulkarni
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20200410/f55c853e/attachment-0001.html>
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.
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.
From: Alexandre Ganea <alexandre.ganea at ubisoft.com>
Sent: Friday, April 10, 2020 4:05 PM
To: Alexandre Ganea <alexandre.ganea at ubisoft.com>; Chris Tetreault
<ctetreau at quicinc.com>; Sudhindra kulkarni <sudhindrakkulkarni102 at
gmail.com>
Subject: [EXT] RE: [llvm-dev] Running clang tests
Even when using cl.exe there’s a significant difference between MSBuild and
Ninja, as you can see in the figures in the review.
De : llvm-dev <llvm-dev-bounces at lists.llvm.org<mailto:llvm-dev-bounces
at lists.llvm.org>> De la part de Alexandre Ganea via llvm-dev
Envoyé : April 10, 2020 6:47 PM
À : Chris Tetreault <ctetreau at quicinc.com<mailto:ctetreau at
quicinc.com>>; Sudhindra kulkarni <sudhindrakkulkarni102 at
gmail.com<mailto:sudhindrakkulkarni102 at gmail.com>>
Cc : LLVM Dev <llvm-dev at lists.llvm.org<mailto:llvm-dev at
lists.llvm.org>>
Objet : Re: [llvm-dev] Running clang tests
Chris,
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: https://reviews.llvm.org/D52193 – I am working on it since last week to
iron out the last issues, I’ll update it soon.
Without that you have to resort to increasing the “maximum number of parallel
builds” to a higher value than the default 2.
De : Chris Tetreault <ctetreau at quicinc.com<mailto:ctetreau at
quicinc.com>>
Envoyé : April 10, 2020 6:36 PM
À : Alexandre Ganea <alexandre.ganea at ubisoft.com<mailto:alexandre.ganea
at ubisoft.com>>; Sudhindra kulkarni <sudhindrakkulkarni102 at
gmail.com<mailto:sudhindrakkulkarni102 at gmail.com>>
Cc : LLVM Dev <llvm-dev at lists.llvm.org<mailto:llvm-dev at
lists.llvm.org>>
Objet : RE: [llvm-dev] Running clang tests
Hi,
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.
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.
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.
Thanks,
Christopher Tetreault
From: llvm-dev <llvm-dev-bounces at lists.llvm.org<mailto:llvm-dev-bounces
at lists.llvm.org>> On Behalf Of Alexandre Ganea via llvm-dev
Sent: Friday, April 10, 2020 1:35 PM
To: Sudhindra kulkarni <sudhindrakkulkarni102 at
gmail.com<mailto:sudhindrakkulkarni102 at gmail.com>>; LLVM Dev
<llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>>
Subject: [EXT] Re: [llvm-dev] Running clang tests
Hi,
LLVM requires Visual Studio 2017 or 2019:
https://llvm.org/docs/GettingStartedVS.html#software – you could use Community
2019.
I don’t recommend building LLVM inside Visual Studio. However you can generate
or update the VS solution once in a while:
* mkdir buildVS && cd buildVS
* cmake {your_llvm_root}/llvm -G"Visual Studio 16 2019" -Thost=x64
-DLLVM_ENABLE_PROJECTS=clang;llvm -DLLVM_OPTIMIZED_TABLEGEN=ON
Use Ninja instead for building: https://ninja-build.org/ it’s a lot faster -
keep Visual Studio only for debugging.
Ensure ninja.exe is in %PATH%.
From a Visual Studio shell (“x64 Native Tools Command Prompt for VS 2019” in the
Start menu) run the following:
* mkdir buildNinjaRel && cd buildNinjaRel
* cmake {your_llvm_root}/llvm -G"Ninja"
-DLLVM_ENABLE_PROJECTS=clang;llvm -DCMAKE_BUILD_TYPE=RelWithDebInfo
-DLLVM_OPTIMIZED_TABLEGEN=ON
* ninja check-all
You can then debug the test in VS:
{your_llvm_root}\buildNinjaRel\tools\clang\unittests\ASTMatchers\ASTMatchersTests.exe
Then re-run “ninja check-clang-unit” or just “ninja” if you want to iterate on
code changes.
Best,
Alex.
De : llvm-dev <llvm-dev-bounces at lists.llvm.org<mailto:llvm-dev-bounces
at lists.llvm.org>> De la part de Sudhindra kulkarni via llvm-dev
Envoyé : April 10, 2020 6:42 AM
À : llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>
Objet : [llvm-dev] Running clang tests
Hi Team,
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.
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.
In my visual studio I have installed Google Test Adapter extension for running
the Google tests.
But the tests under 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.
So can you please let me know if it possible to run these tests in visual
studio. If not how to run them.
Thanks in advance.
Thanks and Regards
Sudhindra Kulkarni
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20200413/20c554d1/attachment-0001.html>
It is technically possibly to integrate ninja into Visual Studio, through the
NMake bindings. We’re doing it with Fastbuild:
<PropertyGroup
Condition="'$(Configuration)|$(Platform)'=='x64-Debug|x64'">
<NMakeBuildCommandLine>cd $(SolutionDir)\..\..\Code\ &
..\Bin\Windows-x64\fbuild -vs -dist -monitor -fastcancel -cache
$(ProjectName)-$(Configuration)</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>cd $(SolutionDir)\..\..\Code\ &
..\Bin\Windows-x64\fbuild -vs -dist -monitor -fastcancel -cache -clean
$(ProjectName)-$(Configuration)</NMakeReBuildCommandLine>
<NMakePreprocessorDefinitions>WIN32_LEAN_AND_MEAN;WIN32;_WIN32;__WINDOWS__;WIN64;DEBUG;PROFILING_ENABLED;</NMakePreprocessorDefinitions>
<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>
<IntDir>$(SolutionDir)\Temp</IntDir>
<OutDir>$(SolutionDir)\Temp</OutDir>
</PropertyGroup>
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.
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.
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).
De : Chris Tetreault <ctetreau at quicinc.com>
Envoyé : April 13, 2020 12:40 PM
À : Alexandre Ganea <alexandre.ganea at ubisoft.com>; Sudhindra kulkarni
<sudhindrakkulkarni102 at gmail.com>
Cc : LLVM Dev <llvm-dev at lists.llvm.org>
Objet : RE: [llvm-dev] Running clang tests
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.
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.
From: Alexandre Ganea <alexandre.ganea at
ubisoft.com<mailto:alexandre.ganea at ubisoft.com>>
Sent: Friday, April 10, 2020 4:05 PM
To: Alexandre Ganea <alexandre.ganea at ubisoft.com<mailto:alexandre.ganea
at ubisoft.com>>; Chris Tetreault <ctetreau at
quicinc.com<mailto:ctetreau at quicinc.com>>; Sudhindra kulkarni
<sudhindrakkulkarni102 at gmail.com<mailto:sudhindrakkulkarni102 at
gmail.com>>
Subject: [EXT] RE: [llvm-dev] Running clang tests
Even when using cl.exe there’s a significant difference between MSBuild and
Ninja, as you can see in the figures in the review.
De : llvm-dev <llvm-dev-bounces at lists.llvm.org<mailto:llvm-dev-bounces
at lists.llvm.org>> De la part de Alexandre Ganea via llvm-dev
Envoyé : April 10, 2020 6:47 PM
À : Chris Tetreault <ctetreau at quicinc.com<mailto:ctetreau at
quicinc.com>>; Sudhindra kulkarni <sudhindrakkulkarni102 at
gmail.com<mailto:sudhindrakkulkarni102 at gmail.com>>
Cc : LLVM Dev <llvm-dev at lists.llvm.org<mailto:llvm-dev at
lists.llvm.org>>
Objet : Re: [llvm-dev] Running clang tests
Chris,
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: https://reviews.llvm.org/D52193 – I am working on it since last week to
iron out the last issues, I’ll update it soon.
Without that you have to resort to increasing the “maximum number of parallel
builds” to a higher value than the default 2.
De : Chris Tetreault <ctetreau at quicinc.com<mailto:ctetreau at
quicinc.com>>
Envoyé : April 10, 2020 6:36 PM
À : Alexandre Ganea <alexandre.ganea at ubisoft.com<mailto:alexandre.ganea
at ubisoft.com>>; Sudhindra kulkarni <sudhindrakkulkarni102 at
gmail.com<mailto:sudhindrakkulkarni102 at gmail.com>>
Cc : LLVM Dev <llvm-dev at lists.llvm.org<mailto:llvm-dev at
lists.llvm.org>>
Objet : RE: [llvm-dev] Running clang tests
Hi,
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.
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.
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.
Thanks,
Christopher Tetreault
From: llvm-dev <llvm-dev-bounces at lists.llvm.org<mailto:llvm-dev-bounces
at lists.llvm.org>> On Behalf Of Alexandre Ganea via llvm-dev
Sent: Friday, April 10, 2020 1:35 PM
To: Sudhindra kulkarni <sudhindrakkulkarni102 at
gmail.com<mailto:sudhindrakkulkarni102 at gmail.com>>; LLVM Dev
<llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>>
Subject: [EXT] Re: [llvm-dev] Running clang tests
Hi,
LLVM requires Visual Studio 2017 or 2019:
https://llvm.org/docs/GettingStartedVS.html#software – you could use Community
2019.
I don’t recommend building LLVM inside Visual Studio. However you can generate
or update the VS solution once in a while:
* mkdir buildVS && cd buildVS
* cmake {your_llvm_root}/llvm -G"Visual Studio 16 2019" -Thost=x64
-DLLVM_ENABLE_PROJECTS=clang;llvm -DLLVM_OPTIMIZED_TABLEGEN=ON
Use Ninja instead for building: https://ninja-build.org/ it’s a lot faster -
keep Visual Studio only for debugging.
Ensure ninja.exe is in %PATH%.
From a Visual Studio shell (“x64 Native Tools Command Prompt for VS 2019” in the
Start menu) run the following:
* mkdir buildNinjaRel && cd buildNinjaRel
* cmake {your_llvm_root}/llvm -G"Ninja"
-DLLVM_ENABLE_PROJECTS=clang;llvm -DCMAKE_BUILD_TYPE=RelWithDebInfo
-DLLVM_OPTIMIZED_TABLEGEN=ON
* ninja check-all
You can then debug the test in VS:
{your_llvm_root}\buildNinjaRel\tools\clang\unittests\ASTMatchers\ASTMatchersTests.exe
Then re-run “ninja check-clang-unit” or just “ninja” if you want to iterate on
code changes.
Best,
Alex.
De : llvm-dev <llvm-dev-bounces at lists.llvm.org<mailto:llvm-dev-bounces
at lists.llvm.org>> De la part de Sudhindra kulkarni via llvm-dev
Envoyé : April 10, 2020 6:42 AM
À : llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>
Objet : [llvm-dev] Running clang tests
Hi Team,
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.
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.
In my visual studio I have installed Google Test Adapter extension for running
the Google tests.
But the tests under 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.
So can you please let me know if it possible to run these tests in visual
studio. If not how to run them.
Thanks in advance.
Thanks and Regards
Sudhindra Kulkarni
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20200413/b9c9ca55/attachment.html>
> If there are pain points with using MSVC or make or whatever, we shouldbe trying to fix then, not just throwing our hands up in the air giving up. The biggest "pain point" for those of us who have made a good-faith effort to go down the MSVC route, has been in how MSVC and/or MSBuild checks and handles dependencies. In practice, during a build, the Visual Studio stack tends to spend a lot of time rebuilding things, that do not necessarily require it. In practice, I find that iteration using Visual Studio is an order of magnitude slower than iterating on a Ninja-based system. If you need to support Microsoft-based technologies, then Visual Studio Code treats LLVM as a first-class customer on Windows. In particular, the clangd plugin within VSCode, provides C++ highlighting and refactoring on par with MSVC. That, plus the CMake plugin, makes VSCode an entirely viable alternative to MSVC, supporting all its key features and adding a few, with quicker iteration time. The VSCode CMake plugin allows you to switch between VC and LLVM compilers trivially, for compatibility testing or whatever, in VSCode. After spending too much time, trying to do LLVM development in Visual Studio, I switched to VSCode and never looked back. Not a paid shill by any means. Just a happier user after making the switch. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200415/a2df1a1a/attachment.html>