On Sun, Jun 8, 2014 at 10:42 PM, Michael Levine <[email protected]>
wrote:

>  As you'll see, I'm trying to make a list of the object files, by
> replacing the .cc extension with .o, and then pass that table to the
> archive and make_shared functions.
>
>
>  However, I'm having troubles with this code- the latest issue that I've
> been having (I've made minor tweaks over the whole day) is that the archive
> function is not working, and the rule is trying to create the file
> liblibs.a with no sources.
>
>
I think the issue is with these if statements:

 if (#objects) then

When there are no objects, #objects is 0, and if(0) is true in Lua (unlike
in C, where it would be false). So you probably want:

if (#objects != 0)

or:

if (next(objects) != nil)

My understanding is the latter is a little more efficient (though I haven't
confirmed it :), but that probably only matters if you have extremely large
tables.

-Mike

-- 
-- 
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