-
Notifications
You must be signed in to change notification settings - Fork 180
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
Allow splitting C++ commands into separate files #2964
Comments
Technically it's already possible just by moving code from a
|
This is true, but I think the requirement for code to be put in I think allowing for a folder with a flat structure (no subdirectories) per command may be beneficial. For example, inside |
In the case where code is very much specific to one command only (and is strongly expected to remain so in the future), your proposal is:
? That would bear certain resemblance to Python in #2920. I'd be happy with that, with the caveat that it would be nice if CMake would figure it out itself on a per-command basis. Indeed, maximising similarity with #2920 would be:
I don't know if there's adequate motivation for such. With C++ we tend to use option groups and parsing functions that get buried into header files, which keeps
So the question is two-tiered:
|
Yes, this is what I had in mind. On CMake doing this automatically, I believe it would be fairly easy to do (all you need to do is compile the extra sources as a static/object library). I still think that we should consider getting rid of globbing though (although in practice, I have to admit that so far I haven't encountered any issues yet), but that's a separate discussion I guess.
In my opinion, that would be unnecessary and overkill. |
We can do this for Python, but not for C++. This wouldn't merely improve consistency, but potentially reduce compilation times by increasing build parallelism and also allow developer to better reason about their code with enhanced readability.
The text was updated successfully, but these errors were encountered: