The cmCommand::cmLuaFunc backend binding has been changed to expect a single array (table) argument instead of a variable number of arguments. The reason for this is that Lua has a max number of arguments that are allowed (set by a #define). The default is 2048. For large CMake projects, users might get into trouble if they have large numbers of files under the variable number of arguments system, whereas an array will not have these limitations. The fancy argument handling wrappers make sure to transparently convert variable number of arguments to a single table parameter so users may not need to know about how the backend expects arguments to be passed. However, users still will need to be aware that passing 2048 unique parameters will cause problems.
If they are encouraged to put their files in
tables which has other advantages such as reusing to specify IDE
adding, installing, frameworks, etc, then the event of a user hitting
the problem becomes remote:
cmake.add_library("simpleLib", cmake.STATIC, sources)
If users don't do this and get into trouble, the work-around is easy
though and can be told to use the following tricks which add braces:
cmake.add_library("simpleLib", cmake.STATIC, {'source1.cxx', 'source2.cxx'})
or
cmake.add_library({"simpleLib", cmake.STATIC, 'source1.cxx', 'source2.cxx'})
In the latter case, since Lua has syntactic sugar for omitting
parenthesis for single argument functions, users may also do this:
cmake.add_library{"simpleLib", cmake.STATIC, 'source1.cxx', 'source2.cxx'}