As my project consists of some mix projects using nifs, I'm trying to make a custom compiler, so that *.c files could be compiled along with these mix projects. Let's say I have a project A, which has a dependency of B, that has some native code depending on C. The problem arises, when C is also a dependency of A - then from Bs perspective location of Cs code is unknown, because it depends on the way of linking C to A (especially when it's linked by path), which makes it impossible to link *.c files of C to B. That is why I would like to have access from a dependency (in this case B) to a roots (A) other dependencies paths. To solve this, I considered putting native sources to the priv
folder, that can be accessed by Application.app_dir/2
, but I don't wish to include the sources in release. Is there any other way to solve it?
Asked
Active
Viewed 67 times
0

Com Piler
- 257
- 5
- 14
-
Would not [umbrella app](https://elixir-lang.org/getting-started/mix-otp/dependencies-and-umbrella-apps.html) solve this issue? – Aleksei Matiushkin Feb 08 '18 at 14:16
-
I think it's not the case - I have mix projects and use some of them in other projects (aggregation), afaik umbrella matches more for one project and its submodules (composition). I am also not sure, how would it help in my case – Com Piler Feb 08 '18 at 16:35