On 12/09/2014 06:10 PM, Alkis Evlogimenos ('Αλκης Ευλογημένος) wrote:
I am building a dsl on top of tup(lua) for my project. What I want to end up with is something like this:

bar = cc_lib {
  name = 'bar',
  srcs = {'bar.cc'}
  -- no deps
} -- creates rules to compile bar.cc and create libbar.a

foo = cc_lib {
  name = 'foo',
  srcs = {'foo1.cc', 'foo2.cc'},
  deps = {bar}
} -- creates rules to compile foo1.cc and foo2.cc and create libfoo.a

cc_bin {
  name = 'runme',
  srcs = {'runme.cc'},
  deps = {foo}
} -- creates rules to compile runme.cc and link it with libfoo.a and *libbar.a*

I didn't find a way to query for the dependency of libfoo.a to libbar.a so that I can pull both in the link rule for runme. I believe tup does not have this dependency in the db either because library archives do not have dependencies. What are my options to track dependencies between libs so that I can specify the transitive closure of deps to the link rule for a binary?
--
--
tup-users mailing list
email: [email protected]
unsubscribe: [email protected]
options: http://groups.google.com/group/tup-users?hl=en
---
You received this message because you are subscribed to the Google Groups "tup-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.

I'm not familiar with cc_lib and cc_bin, but perhaps you could modify cc_lib so that the return value includes dependency information? And then modify cc_bin to use the dependency information.

Alternatively, can't you just include the .a in libfoo.a? That way, by linking libfoo.a, you'll automatically get all the symbols in libbar.a as well. This has a few ways to do it: http://stackoverflow.com/questions/3821916/how-to-merge-two-ar-static-libraries-into-one

--
--
tup-users mailing list
email: [email protected]
unsubscribe: [email protected]
options: http://groups.google.com/group/tup-users?hl=en
--- You received this message because you are subscribed to the Google Groups "tup-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to