I'm writing a library, which has the ability to interoperate with SDL, but in the event that SDL does not exist, is still useful on its own. I want to have it build regardless of whether or not SDL exists, and simply disable functionality.
So far, I have the SDL extensions inside an #ifdef which checks for _SDL_H (SDL.h defines this). I include SDL with the statemene
Then, I create a folder, "dummy," in which I have a blank file called "SDL.h" The Makefile adds "dummy" to the build path, but after everything else. That way, if the user adds an -I/usr/include/SDL (or whatever form your operating system works with), it gets built with the SDL extensions, but if not, it builds without them. Is this a bad way of implementing everything?Code:#include "SDL.h"