[SERVER-7653] Generated headers should have a new path Created: 13/Nov/12 Updated: 28/Aug/23 Resolved: 28/Aug/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Build |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Mathias Stearn | Assignee: | [DO NOT ASSIGN] Backlog - Server Development Platform Team (SDP) (Inactive) |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Server Development Platform
|
| Participants: |
| Description |
|
I suggest BUILD_DIR/VARIANT/generated/header.h The current solution of putting the header in the same path but within BUILD_DIR causes problems when switching between branches that do and don't generate the header. When switching to a branch from before it was generated you have to manually delete the header from the build dir. |
| Comments |
| Comment by Andy Schwerin [ 14/Jan/13 ] |
|
I don't think it would. The names of some of the auto-generated files might change, but that's probably it. If we were consistent, the .gitignore could be for -auto., or something similar. |
| Comment by Tad Marshall [ 14/Jan/13 ] |
|
Does this have any implications for Visual Studio builds? The only funky thing we have right now is the need to .gitignore some generated files that the Visual Studio build creates but that we don't want to store in the repository. |
| Comment by Andy Schwerin [ 14/Jan/13 ] |
|
redbeard0531, thanks for the clarification. I prefer having the file name rather than the directory name indicate the auto-generated-ness of the file, but otherwise I think we pretty much agree. -auto. {h,cpp}sound good to you? |
| Comment by Mathias Stearn [ 14/Jan/13 ] |
|
Sorry if this was unclear. My idea was that instead of adding "generated" to the CPPPATH, we'd change all #includes to say "mongo/generated/header.h". This way checking out a different version of the code would pull in the correct non-generated files. Mutating the file name would have the same effect though. The most important goal is that when an existing file is removed and made auto-generated it shouldn't keep its original #include name. How that is achieved doesn't make much difference to me. |
| Comment by Andy Schwerin [ 17/Dec/12 ] |
|
The proposed change doesn't fix the problem. The "generated" directory would have to always be in the include search path, ahead of the non-auto directory, so you wouldn't really fix the symptom. An alternative that would is to have all auto-generated files have a suffix, like XYZ-auto.h. Then, you'd create a non-auto-generated variant, XYZ.h (or .cpp), and in branches where you auto-generated, that would just include XYZ-auto.h (or XYZ-auto.cpp). |