Conditional code based on config

Yep.

Is :my_lib a dependency of the project?

Yes, exactly.

So when I compile the project (MyApp) I see

==> my_lib
Compiling 3 files (.ex)

[warn]  unavailable
Generated my_lib app
==> my_app
Compiling 82 files (.ex)
Generated my_app app