-
-
Notifications
You must be signed in to change notification settings - Fork 649
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
Move single header to a separate folder #187
Conversation
Now, |
@dimztimz Hi! This was actually a long-standing pain-problem for me! I haven't looked entirely into the PR but on first thought I'm a bit hesitant to accept this. I'm not sure I want to go the route of catch and have 2 headers with the same name, where one is in a I see that the single header is at least always rebuilt, just like before, but the example targets don't depend on the One thought that occurred to me is that the final header might remain where it used to be, but the examples could be using a header (which includes the 2 parts) from a different place just for development purposes - just like there is an "out of sight" special source file part of the examples located in I'll have to think about this... some other opinions would be appreciated as well. Aaand I wrote you an e-mail a few hours ago at |
It is a braking change only for the users who are consuming the single header directly from the source tree from the branch master with The following users won't be affected:
IMO it is a bad idea to keep generated source code along the real source files.
Seems like overly complicated to me. With this change we achieve the following:
|
It is much better for tests and examples to directly depend on the original sources as errors and warnings are properly reported. Previously, errors are warnings were reported against the single include, but had to be fixed in doctest_fwd.h and doctest.cpp.
CI finally passed. |
There's another use case, which I personally employ often: Plain old copy Granted, it's not a huge effort to copy two files instead of one and the increased maintainability is indeed an appealing argument. I'd personally suggest taking a bit from both: Change the examples to use the dual file setup and the docs to suggest it. Change the unified file to include both. But! Make a CMake install step which generates a unified file and still deploy the unified file in releases as another downloadable asset besides the zipped sources from the repo. |
@iboB That is already handled. Give a closer look in the folder single_include. |
Sorry this is taking so long. I have a bunch of other things to do and am not 100% sold on the idea here. One thing that occurred to me is that I could use I recognize that this is even more complicated - your solution is certainly more clean and doesn't require the use of custom I'll think about this a bit more. |
Well another solution is to not generate the single header in the source tree. Instead, generate it in the build tree and on If you ask me this way is the cleanest way, source files go to source dir and everything generated goes to build dir. |
I decided to merge this, but I'll change a few things after that:
this way users won't be wondering which header to use because the "dev" one will be hidden. |
Description
It is much better for tests and examples to directly depend on the original sources as errors and warnings are properly reported.
Previously, errors are warnings were reported against the single include, but had to be fixed in doctest_fwd.h and doctest.cpp.
The C++ and CMake part are done properly, the python scripts and CI that may need changing to accommodate for this change. They need to push the new single include.