Hacker News new | ask | show | jobs
by jhasse 3397 days ago
I really hope they add wildcard (e. g. src/*.cpp) support in C++ project files
3 comments

Visual studio already supports this in 2015 and older iirc, at least for C# and SQL projects, but it's an undocumented feature. You have to close and re-open the project if you add/remove a file so it notices that it's different.

part of the new project system that grew out of the ill-fated project.json is to make this a first-class experience, but again that's focusing on the .csproj, I have no idea if it applies to C++.

It also works in C++ projects. But it breaks a bunch of IDE stuff, e.g. Add New Item.
It does support it (though, it can use a lot of CPU for some reason)
Does that feature exist in other Visual Studio project types? There's always CMake to help in situations like that.
It does and can most likely be enabled by editing the vcxproj directly. Edit: something along the lines of:

    <ItemGroup>
        <Content Include="**\*.h" />
        <Content Include="**\*.cpp" />
    </ItemGroup>
Edit: see response.
This is correct, take a look at https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuil... and child topics on inclusion/exclusion.

-eric PM, VC++ team

While it does work in the builds, the IDE is not supporting this particularly well. As another comment pointed out, changes on the filesystem are not automatically detected. Also, some IDE functionality doesn't work propetly in a project with <ClCompile Include="*.cpp"/> - for example, Add New/Existing Item fails with an error.
That should probably be

    <ClCompile Include="**\*.cpp" />
at least if you want to get the sources compiled