How to best include a C library from github in my github project

I have a project on github. I want to use several 3rd party libraries that are also on github (such as: https://github.com/lz4/lz4). I want to know the best way to pull 3rd party code into my project. Looking at other projects that use lz4, I see several approaches:

  1. Some people copy the entire contents of lz4 (or other 3rd party code) and commit into a subdirectory of their project.
  2. Others create a fork of lz4.
  3. Stackoverflow answers have suggested using git submodule add.
  4. I assume some people just git clone lz4 when needed, but don't commit lz4 into their own git repo.
  5. Are there other approaches I'm missing?

What are the pros and cons of those approaches and why do people choose different approaches? In most cases, I do not want to change the 3rd party library at all, but in a few cases, I might want to make minor changes.



Read more here: https://stackoverflow.com/questions/67943386/how-to-best-include-a-c-library-from-github-in-my-github-project

Content Attribution

This content was originally published by Alan at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: