OOLua  2.0.1
C++ and Lua binding
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Building

OOLua's source code can either be dropped into the path for a project , amalgamated to a single header and source file or compiled as a static library.

Makefiles and IDE projects

OOLua does not provide solution files instead it provides Premake4 [1] scripts. Premake is a simple [2] to use IDE project or makefile generator that can be used to help create a static library or to run Library Tests

Premake format

premake4 [make or IDE] [target operating system]

Makefile

premake4 gmake []
  • macosx
  • linux

Xcode

premake4 xcode[] macosx
  • 3
  • 4
    Note
    macosx is required

Visual Studio

premake4 vs[] windows
  • 2005
  • 2008
  • 2010
  • 2013
    Note
    windows is required

CodeBlocks

premake4 codeblocks []
  • windows
  • linux
  • macosx

Library limits

The "oolua_generate" Lua module provides information about the default limits for the library. It enables the generation of boilerplate code using user defined limits or regeneration of files with the default values. The details of these configurable values being :

return
{
lua_params =
{
desc ='Maximum amount of parameters for a call to a Lua function'
,value=10
}
,cpp_params =
{
desc='Maximum number of parameters a C++ function can have'
,value=8
}
,constructor_params =
{
desc='Maximum amount of parameters for a constructor of a proxied type'
,value=5
}
,class_functions =
{
desc='Maximum amount of class functions that can be registered for each proxied type'
,value=15
}
}

The most common change to these options is the number of functions which can be registered for a proxy class, this limit applies individually to constant and none constant functions, base class methods that are registered in a base class do not decrease the count for a derived class.
Using the Lua interpreter to regenerate the OOLua files increasing this option whilst using default values for the remaining options:

lua -e "require'build_scripts.oolua_generate'.gen({class_functions=30},'include/')"

For convenience you do not need a version of Lua installed on a machine to run this module, Premake the project file generator used in OOLua already contains a copy of Lua 5.1 (it has some modifications to the core libraries). To generate the files with the same options as above :

premake4 --class_functions=30 oolua-gen

The module returns a table with the following functions

return { gen = gen, defaults=defaults, default_details=default_details }

Library Config

See Also
Library Configuration

Build Scripts

[make or IDE]_build.[sh or bat]

When these build scripts are run from the build_scripts directory they create a "../local_install" directory into which newly compiled debug and release static libraries will be place along with the library headers in a sub directory "oolua".

Test Unit scripts

[make or IDE]_tests.[sh or bat]

The scripts test the library using exceptions and error return values in both debug and release configurations. When run from the build_scripts directory these will produce compiler and test unit output saved to disk in the directory "../build_logs", if an error occurs during a test then a message to stdout will inform of where to locate the full error message and compile log. These test scripts clean up any other files produced during their running.

[1] Premake download http://industriousone.com/premake/download

[2] Premake quick start http://industriousone.com/premake-quick-start