Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Infrastructure] Add header files to native Visual Studio coreclr projects #9234

Open
4creators opened this issue Nov 6, 2017 · 14 comments
Open
Assignees
Labels
area-Infrastructure-coreclr backlog-cleanup-candidate An inactive issue that has been marked for automated closure. enhancement Product code improvement that does NOT require public API changes/additions no-recent-activity
Milestone

Comments

@4creators
Copy link
Contributor

Currently CMake is used according to standard pattern where only .cpp file are included into targets with library or executable. However, this pattern breaks some usability of CMake created Visual Studio projects since they do not include header files by default and it is necessary to search for them in VS project dependencies directory containing several hundred files or scroll to top of code file and click "open file" on include directive. Obviously none of this is convenient even for medium sized code files.

If proposal will be accepted I could provide PR with required changes.

@4creators
Copy link
Contributor Author

cc @weshaggard @janvorli

@RussKeldorph
Copy link
Contributor

@dotnet/coreclr-contrib @dotnet/jit-contrib @janvorli I may not fully understand, but I assume this would increase the maintenance burden of cmake project files. Can you guys vote (👍, 👎) on the initial comment for whether you would like @4creators to proceed?

@janvorli
Copy link
Member

janvorli commented Dec 1, 2017

@RussKeldorph you are right it would increase the maintenance burden, but I don't think it would be a significant increase due to the fact that it is very rare to add or remove a header to coreclr. But the issue I have with it is that it would bloat the CMakeLists.txt files. Especially in cases where the list of files compiled depends on target architecture and also whether we build debugger DAC stuff or the target binary. Then the includes would also need to be conditionalized accordingly. See e.g. src/vm/CMakeLists.txt.
So I am torn here, since I can also see the benefit of having the headers listed in the visual studio per project.

4creators referenced this issue in dotnetrt/coreclr Sep 15, 2018
4creators referenced this issue in dotnetrt/coreclr Sep 15, 2018
@AaronRobinsonMSFT
Copy link
Member

I am inclined to accept this, but I would hope the generated MSBuild project files use the appropriate Item tags. @4creators can you confirm the tags the generated project files uses for these header files?

@4creators
Copy link
Contributor Author

@AaronRobinsonMSFT

CMake by default classifies C++ files based on their extension and it means that all header files (.h, .hpp, .inl) are Header Files and are not passed to the compiler. Depending on which file types are passed to CMake C++ project additional filters for those file types are added to vcxproj. Existing examples are below:

clrgc and clrjit projects with headers

clrgc-clrjit-vcxproj

clrgc expanded headers

clrgc-headers-vcxproj

clrgc expanded sources

clrgc-sources-vcxproj

@AaronRobinsonMSFT
Copy link
Member

@4creators What is shown in the Solution explorer isn't actually relevant in this case - at least from a build perspective. That is handled by the .filters file and is orthogonal to what is defined in the generated .vcxproj file. Can you open the .vcxproj and ensure all header files are included using the ClInclude tag (e.g. <ClInclude Include="pch.h" />)? Thanks.

@4creators
Copy link
Contributor Author

This is xml code inside clrjit.vcxproj showing end of <CLCompile Include="" /> nodes and start of <CLInclude Include="" />. As you can see all source files and header files are included via correct nodes:

clincludeitems-clrjit

@AaronRobinsonMSFT
Copy link
Member

Looks great! I think this is definitely worth doing.

@janvorli any other concerns?

arr

@AaronRobinsonMSFT
Copy link
Member

Can we close this now?

@4creators
Copy link
Contributor Author

@AaronRobinsonMSFT Not yet. There are several projects which are waiting for conversion. I am doing it step by step.

4creators referenced this issue in dotnetrt/coreclr Sep 27, 2018
@janvorli
Copy link
Member

@4creators I think you have converted all of the projects already and the issue can be closed, right?

@4creators
Copy link
Contributor Author

@janvorli There are still 3 small ones to be converted. I will try to go back to them in September if that's OK.

@janvorli
Copy link
Member

@4creators of course! Thank you.

@msftgits msftgits transferred this issue from dotnet/coreclr Jan 31, 2020
@msftgits msftgits added this to the Future milestone Jan 31, 2020
Copy link
Contributor

Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process.

This process is part of our issue cleanup automation.

@dotnet-policy-service dotnet-policy-service bot added backlog-cleanup-candidate An inactive issue that has been marked for automated closure. no-recent-activity labels May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Infrastructure-coreclr backlog-cleanup-candidate An inactive issue that has been marked for automated closure. enhancement Product code improvement that does NOT require public API changes/additions no-recent-activity
Projects
Status: No status
Development

No branches or pull requests

5 participants