Closed detly closed 5 years ago
How to I achieve that?
If you want a single static library, the best way to achieve this is to have a single static library. What you attempted to do isn't supported by GCC and Clang, so I'm going to close this as Premake won't be supporting this either.
So does that mean I have to duplicate all of the files
calls up to the top level project? I don't think Premake supports any kind of "object library" style of arranging modular dependencies, does it?
So does that mean I have to duplicate all of the
files
calls up to the top level project?
You can, don't forget you do have Lua available to you, so you can utilize the language to avoid duplicating the actual lines by duplicating the data at runtime instead.
I don't think Premake supports any kind of "object library" style of arranging modular dependencies, does it?
If you mean some way to say "anything that links this library, also needs this stuff", Premake doesn't support that. It has been a discussion item for a number of years, but it's a non-trivial system that nobody has had time to invest in.
You can, don't forget you do have Lua available to you, so you can utilize the language to avoid duplicating the actual lines by duplicating the data at runtime instead.
Perhaps a set of get_a_sources()
, get_b_sources()
functions that return the data in question would be the way to go (I have a similar thing for project generation elsewhere).
If you mean some way to say "anything that links this library, also needs this stuff", Premake doesn't support that. It has been a discussion item for a number of years, but it's a non-trivial system that nobody has had time to invest in.
I was thinking more "this .o
files as a first pass, and then later archiving/linking them as needed.
I have this
permake5.lua
:The files
a.c
etc. just containvoif f_a(void)
. Running premake5 (v. 5.0.0-alpha14) and then make shows:I was hoping to end up with a static library containing code from a, b and c. I may have misunderstood how linking a static library works. How to I achieve that?
(Alternatively I could have some config that results in building a bunch of
.o
files and then linking those into a library in the final stage, but I don't think that's easy to do.)