If you combine a project that compiles your open source library as a static library, and other projects reference your static library instead of directly compiling the source code, this will work. Other projects can embed your library project file if they want your library to be compiled before they are used, or you can just distribute the static library precompiled.
source share