Open skaravos opened 2 months ago
On a somewhat related note.
Right now the module has a hard-requirement on finding the GIT_EXECUTABLE if the GIT_WORK_TREE
argument is provided in the call to add_version_info_target()
.
This causes problems if the project is being compiled from a standalone copy of the source code.
A project being compiled from source may not always be compiled from inside its git repository, and it would be deranged to expect the user to edit the CMakeLists.txt file to remove the GIT_WORK_TREE
argument every time they are compiling the project from a non-repo directory.
Would it be better to instead emit a WARNING message instead of an ERROR when either the git executable cannot be found, or if the given work tree isn't a repository?
brainstorming for my future self
When projects are compiled inside containerized CI/CD environments, the (docker) container that actually runs the configuration & compilation may not have access to
git
, or the project's.git
repository information may not be present. In these cases, even though the build container can't access the git info, the CI/CD runner should have access to all the git repository information before the job is dispatched to the build container. So it would be nice to be able to forward this knowledge along to the submodule in the form of environment variables.I'd need to test the idea more thoroughly, but I'm thinking something along the lines of: