I have a software that I'm sharing under MIT license. I would like to add some GPL library to accelerate some algorithms. I #ifdef the includes and calls to this library so that my application can be compiled without the GPL code. The include statements to this third party library and references to it in the makefile are still there though. Can I keep the MIT license on my software project or do I need to change it to GPL? How do I need to structure the license of my git repository in this case?
-
Here's a project with the same MIT+GPL combination: github.com/newren/git-filter-repo (git recommends you use this tool instead of filter-tree, so it's very likely their team has seen the licensing bit). And here's an answer from an ffmpeg maintainer (ffmpeg uses LGPL+GPL): video.stackexchange.com/a/14804– galdinAug 11, 2020 at 12:19
1 Answer
You can license your source code under MIT, since your source code doesn't contain GPL-covered parts.
However, when you compile the software with the GPL component, then the binary as a whole can only be licensed under the GPL with all the obligations that implies, like providing the complete corresponding source code of the binary – including your MIT-licensed parts. There is no fundamental difference between an MIT project including GPL code vs a GPL project including MIT code.
-
Thanks! I currently use the default github generated MIT license - so there is simply a LICENSE file in the root of the repository with the MIT. Do I need to specially mention in it that the software won't fall under MIT depending on how it is compiled? Aug 11, 2020 at 9:51
-
7@user1282931 It would be helpful – but is not required – to inform users about this. Perhaps your build instructions are a good place, perhaps a license information paragraph at the end of the readme. For example: “All the code in this project is available under the MIT license. If you compile with `-DSOME_FEATURE, the GPLv3-covered libfoo will be linked.”– amonAug 11, 2020 at 12:21