Is it practical to use #ifdef's to compile a library without certain features?
<p>So I'm currently working with a proprietary programming language that is C-like. So while this question wasn't directly inspired by a C program, I think those of you who are familiar with C may be able to offer some good insight.</p>

<p>I'm currently working on a library. This library encompasses some basic features as well as features that require other libraries. I'm running into the problem of 'where do I draw the line for how many dependencies are included in this library?'.</p>

<p>So this seems like it could be a fairly common problem. What methods exist for addressing this issue?</p>

<p>Something I've had in mind. Implement #defines and #ifdefs that allow users to compile the library with only the features they want. So essentially, all of the library functions that require additional libraries would be wrapped in #ifdef guards. The user would be responsible for #define'ing the features they want. Essentially, this method would allow a user to still use parts of the library without needing to have other dependent libraries.</p>

<p>Your thoughts? Again, this is for a C-like language. Thus tools like CMake, etc. aren't available.</p>