15.03.2012, 09:11, "Jason McKesson" <korv...@gmail.com>:
> It's a *build system*, not an application; it's not that complicated.
> And if your build system is so big and complex that you can lose track
> of what globals, add-ons, and so forth you've included, something has
> gone wrong somewhere.

Premake is an application, and it's already complex. Add-ons are supposed
to extend *Premake* out-of-the-box capabilities and may be written by
3rd parties.

> Remember: build rules are supposed to be the exception, not the default.

For my use cases they will be default (e.g., Qt support requires at least 6 
build
rules). Also remember that build rules can be used to implement support for
programming languages other than C/C++, code generators, and preprocessors. 

>
>>>  That being said, it might not be a bad idea to allow a command to be a
>>>  Lua function. That is, you can do something like this:
>>>
>>>  commands = {
>>>      function(context)
>>>        return --string of the command to use.
>>>      end
>>>  },
>>>
>>>  This would be a lot easier to implement than what you're trying to do.
>>>  The `context` would just be some kind of object you could query things
>>>  like `cfg.objdir` and so forth from.
>>  AFAIU it does the same as %(--string of the command to use),
>>  but provides one context table instead of several independent ones
>
> Yes, and it's also much, *much* easier to implement the way I've put it.

I don't think so - loadstring is not difficult to use.

> The way you've described it, the system has to detect that
> "rule.compiler" accesses some context data, while "if not
> rule.flags.DebugInfo then return "-s" end" is a Lua chunk with its own
> return statement. This requires that Premake actually *parse* the text
> within the %() segment to figure out if it's just accessing context data
> (something that you can prepend "return context." to and get a valid Lua
> chunk) or an actual Lua chunk to be executed.

I think it will always load chunk. Jason: could you clarify this?

> At the very least, it should use different syntax, like "#()" or something.

Could you explain why "#" is better than "%"?

-- 
Regards,
Konstantin

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Premake-users mailing list
Premake-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/premake-users

Reply via email to