# Conditional code based on config

**URL:** <https://forum.elixirforum.com/t/conditional-code-based-on-config/31955>\
**Category:** Questions\
**Tags:** metaprogramming, compiling\
**Created:** [May 31, 2020, 12:01am UTC](https://forum.elixirforum.com/t/conditional-code-based-on-config/31955 "2020-05-31T00:01:34Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![kip](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/32/1440_2.png) [@kip](https://forum.elixirforum.com/u/kip)\
**Post date:** [May 31, 2020, 7:31pm UTC](https://forum.elixirforum.com/t/conditional-code-based-on-config/31955/8 "2020-05-31T19:31:12Z")

</div>

Ah, I see. Compilation order is dependencies first, then the current project. Where current project is the one that has `mix.exs` in it when you did `mix.compile`. Dependencies are compiled first and they do not create a transitive association with the “current” project. Understandably so - libraries aren’t built to make assumptions about the projects that use them.

TLDR; A dependency depending on the consumer of the dependency isn’t going to work

---

_[View the full topic](https://forum.elixirforum.com/t/conditional-code-based-on-config/31955)._
