14.03.2012, 23:06, "Jason McKesson" <korv...@gmail.com>:
> commands = {
>    function(context)
>      return --string of the command to use.
>    end
> },

This syntax is really useful when sting needs complex flag-dependent logic, e.g.

 commands = {
    function(context)
      local flags = ""
      if context.rule.flags.A then
        if context.rule.flags.B then
          flags = "-AB"
        else
          flags = "-C" 
      end
      return "tool " .. flags .. -- input and output follow here
    end
 },


Pattern version would require custom buildrule field here

 getflags = function(flags)
      local flags = ""
      if flags.A then
        if flags.B then
          return "-AB"
        else
          return "-C" 
      end
      return ""
 end,

 commands = {
      "tool %(rule.getflags(rule.flags) .." -- input and output follow here
 },

-- 
Regards,
Konstantin

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Premake-users mailing list
Premake-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/premake-users

Reply via email to