Re: [off-topic] Sample to use "include-what-you-use" with Visual Studio and CMake

classic Classic list List threaded Threaded
3 messages Options
jasonbeverage jasonbeverage
Reply | Threaded
Open this post in threaded view
|

Re: [off-topic] Sample to use "include-what-you-use" with Visual Studio and CMake

This is awesome, I'll take a look at this tomorrow.   I didn't realize include what you use worked with ninja.   

On Sun, Dec 15, 2019, 5:27 PM remoe [via osgEarth] <[hidden email]> wrote:
Hi Folks

I was motivated to use "include-what-you-use" ( https://include-what-you-use.org/ ) in Visual Studio with CMake/Ninja. So, I tried to make a sample, because i didn't find an existing sample. My sample is trying to detect Visual Studio and create a VisualC++ compiler environment without running "vcvarsall.bat" before CMake.

https://github.com/remoe/CMakeVStudioIwyuNinjaSample

Next task could be an optimization of osgEarth 3.0 includes ;)

Cheers
Remo Eichenberger, Switzerland



If you reply to this email, your message will be added to the discussion below:
http://forum.osgearth.org/off-topic-Sample-to-use-include-what-you-use-with-Visual-Studio-and-CMake-tp7592988.html
To start a new topic under osgEarth, email [hidden email]
To unsubscribe from osgEarth, click here.
NAML
jasonbeverage jasonbeverage
Reply | Threaded
Open this post in threaded view
|

Re: [off-topic] Sample to use "include-what-you-use" with Visual Studio and CMake

So does osgearth need to be able to compile using clang on windows for IWYU to work?   I've looked at it before but didnt think it works with visual studio.  

Jason

On Sun, Dec 15, 2019, 8:36 PM jasonbeverage [via osgEarth] <[hidden email]> wrote:
This is awesome, I'll take a look at this tomorrow.   I didn't realize include what you use worked with ninja.   

On Sun, Dec 15, 2019, 5:27 PM remoe [via osgEarth] <[hidden email]> wrote:
Hi Folks

I was motivated to use "include-what-you-use" ( https://include-what-you-use.org/ ) in Visual Studio with CMake/Ninja. So, I tried to make a sample, because i didn't find an existing sample. My sample is trying to detect Visual Studio and create a VisualC++ compiler environment without running "vcvarsall.bat" before CMake.

https://github.com/remoe/CMakeVStudioIwyuNinjaSample

Next task could be an optimization of osgEarth 3.0 includes ;)

Cheers
Remo Eichenberger, Switzerland



If you reply to this email, your message will be added to the discussion below:
http://forum.osgearth.org/off-topic-Sample-to-use-include-what-you-use-with-Visual-Studio-and-CMake-tp7592988.html
To start a new topic under osgEarth, email [hidden email]
To unsubscribe from osgEarth, click here.
NAML



If you reply to this email, your message will be added to the discussion below:
http://forum.osgearth.org/Re-off-topic-Sample-to-use-include-what-you-use-with-Visual-Studio-and-CMake-tp7592989.html
To start a new topic under osgEarth, email [hidden email]
To unsubscribe from osgEarth, click here.
NAML
remoe remoe
Reply | Threaded
Open this post in threaded view
|

Re: [off-topic] Sample to use "include-what-you-use" with Visual Studio and CMake

Hi Jason

The docs says, it should work:

https://github.com/include-what-you-use/include-what-you-use#how-to-run

Note that with Microsoft's Visual C++ compiler, IWYU needs the --driver-mode=cl argument to understand the MSVC options from CMake.

by using:

"--driver-mode=cl"

https://github.com/remoe/CMakeVStudioIwyuNinjaSample/blob/master/CMakeLists.txt#L92

But I've currently only checked a simple HelloWorld :)
Remo Eichenberger, Switzerland