-
-
Notifications
You must be signed in to change notification settings - Fork 650
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
The build writes into the source directory #249
Comments
I'll look into this as soon as I can. |
Well this is a pretty obscure problem... not sure if anything should (or could) be done about it. When in CMake the project is used as a subdirectory the command which assembles the doctest.h header doesn't run either, and the header is committed in it's assembled form anyway. I'm closing this for now - if there are any ideas by anyone which don't require substantial changes I could incorporate something in the future. |
What exactly are the requirements of a solution?
Those requirements are not incompatible. Committers can always manually copy the file from CMAKE_BINARY_DIR into CMAKE_SOURCE_DIR before doing a commit. But "manually" is a dirty dirty word which always causes problems. You still need to manually do |
I simply do a build which always assembles the single header (the command is here: https://github.com/onqtam/doctest/blob/2.3.4/CMakeLists.txt#L30) and then I That custom command is there only What is your use case? Why would you checkout doctest, not use it as a subproject and want to build the tests locally in a read-only place? |
We have lots of small projects using doctest. So instead of adding it as a submodule to all of them we "build" it separately and then make it a "dependency" of those projects. We do that with lots of libraries (some of them not so simple to use as submodules) using a custom packaging system. Whenever we want to update doctest we only have to do it from one place (you could well argue that each project should stay with the version of doctest it has been tested against, but we don't). At the end of the day it's not a big deal to us. We simply have added a step in the packaging recipe to first copy the sources into the build directory, which is obviously not read-only. So don't worry about it. |
you could also skip the build process since it's just a header and trust the release engineering and CI of doctest :D kidding. Well good to know that this is a potential issue. I'll leave it closed for now but if anyone else stumbles upon this it could be reopened. |
During the build
doctest/doctest.h
is generated into CMAKE_CURRENT_SOURCE_DIR, which makes it fail if the directory is read-only.The text was updated successfully, but these errors were encountered: