What's the purpose of defining a Cl task in msbuild like this?
<ItemGroup>
<ClInclude Include="Something.h" />
</ItemGroup>
Is this necessary? It seems like just have #include "Something.h"
in the source file should be sufficient. What purpose does the ClInclude task then fulfill?0
It's basically just for use in the Visual Studio user interface: if you view projects in Solution Explorer and 'Show All Files' is turned off, it shows only what is defined in the different Items which serve as input for the build (ClInclude/ClCompile/Resource/...). So even when the compiler happily finds the include file, the IDE won't list it in Solution Explorer. Also functions like 'Go To Files' won't consider the file.
With 'Show All Files' turned on you get to see the whole directory structure, usually a better experience in my opinion, though it still shows files which aren't listed in the project explicitly with a red sign to incidate that. But then at least you can right-click on them and choose 'Include in Project' instead of finding them manually.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With