2

SFML, in this case, has a Git repo and a download page. Until now I have always downloaded from the download page, which came (at least for the compiler I use) with .a and .hpp files and could easily be used with MinGW with -l and -i tags.

When I wanted to use this on Github, though, a couple of problems arised.

  1. When copying it into the repo on the first commit, the Github graph would show 22k changes on the first commit and only a couple hundred on the following commits. I got around this by putting the download into a private repo and using it as a submodule. This isn't very elegant and still has the problem of being OS/compiler-specific.

  2. Using the official Github repo as a submodule. But how do you use external raw cpp and hpp files? Do you put the necessary cpp files into the Makefile? If so, what are the downloads on the download page for?

  • My friend told me today that you don't put external libraries in git, but you let others download them for themselves – Post Self Jan 23 '17 at 11:27
  • Should that library be added to .gitignore or to .git/info/exclude, though? – Post Self Jan 23 '17 at 16:13
  • You can add the libraries as a git submodule, but most libraries aren't really set up properly to use that. It works quite well for the ones that do though. – jaked122 Jan 24 '17 at 1:32
3

Adding a library in your git repo would make you a maintainer of another version of the library. You want to avoid that as much as possible.

Depending on the library and the target OS, the most reasonable approach is to have it listed as a dependency in the README, along with good documentation on how to install it on all target operating systems, or links to resources that describe how to install it. Maybe, if possible, provide an automated script, but it's not really necessary and not really helpful since building from source should be reserved to developers and power users.

For "normal" users, you should provide binaries that integrate with the operating system's dependency manager (preferably) or just contain a copy of the library.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.