Possible to only compile some scripts?

I’ve got a set of “library” classes and extension methods I use (published on github). I use git to version my projects, and I’d like to use git submodules to manage “importing” the unity-utilities repository into my current repository.

The problem is that parts of my repository depends on another library (AngryAnt’s Path in this case), so it doesn’t compile if that library is not present in the project. Not all of my projects include Path - and these projects don’t need this part of unity-utilities.

So here’s the challenge: How do I prevent it from compiling these (unused) classes when I’m using it in a project without Path? I can’t comment out the code, because it’s shared code. I tried checkout the submodule outside of Assets and symlinking the parts I use into Assets, but symlinks are not supported on OS X.

Any other ideas?

How about doing some conditional compilation and set a #if around the code that is only some compiled on occasion - then you could set the #define somewhere and get it switchable? WARNING: I haven’t used this but see this thread in which some very smart people discuss a way of getting the #define globally for your project.