My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
Building  

Featured, Phase-Deploy
Updated Jun 4, 2010 by liamdev...@gmail.com

Building OOLua version 1.3

For Version 1.2 please see Building_1_2

Requirements

Premake

Makefiles, IDE Projects and use of Build Scripts:

Premake - version 4.2 Premake quick start

Additionally for Unit Tests or use of Test Unit Scripts:

Cpp Unit

CppUnit - version 1.12.1 Getting to know CppUnit

Google Mock

Google Mock - version 1.4 or 1.5

Compile Scripts

Two type of scripts are present test unit scripts and build scripts.

Test Scripts

Naming is of the format

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

When run from the test_unit directory these will produce compiler and test unit output saved to disk located in a directory create named "../build_logs". These scripts clean up any other files produced during there running.

Build Scripts

Naming is of the format

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

When run in the test_unit directory it compiles the library debug and release versions. These static libraries can be found in the "local_install" directory along with copies of the header files in a directory below this named "oolua". All other files created during the running are deleted.

Building Makefiles or IDE projects

OOLUA's source and header files can added to your project or be compiled as a static library. To compile as a static library or to run the UnitTests, Premake version 4 is the recommended method to generate make files/IDE projects. This can either be accomplish using the following details or using the pre-existing bash or bat files( see Compile_Scripts).

Premake Format

premake4 [make or IDE] [target operation system]

Makefile

premake4 gmake []
  • macosx
  • linux

Xcode

premake4 xcode3 macosx

macosx is required

Visual Studio

premake4 vs[] windows

windows is required

  • 2005
  • 2008



Visual Studio 2010

Visual Studio 2010 (vs10) is not currently supported by premake yet if you have vs10 installed you can run the following command, it will generate vs9 projects and update them using the vs10 command line tool.

premake4 vs2010

As vs10 adds files which have not been created directly by premake, a specific clean operation has been added to the premake script.

premake4 cleanVS10

Scripts to build a local install, build and run unit test etc. have been added for vs10 in the script directory.

Code::Blocks

premake4 codeblocks []
  • windows
  • linux
  • macosx

Config

A configuration header is now included to control what features are present in the library, see oolua_config.h for more information. To turn a feature on, define it to have a default value of 1 in config or predefine it to have this value.

MacroDefault valueDescription
OOLUA_RUNTIME_CHECKS_ENABLED 1 Checks that a type being pulled off the stack is of the correct type. If this is a proxy type, it also checks the userdata on the stack was created by OOLua
OOLUA_STD_STRING_IS_INTEGRAL1If 1 Allows std::string to be a parameter or a return type for a function.

NOTE: This is always by value.
OOLUA_SAFE_ID_COMPARE1If 1 then checks id lengths and if the same compares with a memcmp.

If 0 compares the address' of the id strings
OOLUA_USE_EXCEPTIONS0If 1 Throws exceptions from C++ code. This could be the return of a pcall when pulling an incorrect type of the stack if.

See Building_1_3#Error_Note
OOLUA_STORE_LAST_ERROR1When an error occurs, the error is stored in the Lua registry and is retrievable via OOLUA::get_last_error(lua);

See Building_1_3#Error_Note
OOLUA_DEBUG_CHECKS1Checks for null pointers adds a stack trace to messages called within pcall.

Note: Default value is when complied as a debug version of the library.

Error Note

It is an error to have both OOLUA_USE_EXCEPTIONS and OOLUA_STORE_LAST_ERROR set to 1

File generator

The library comes with a file generator project which when compiled is a command line executable. Running it allows you to easily generate C++ source files with new limits set via the command line.

NameDefault value if not definedDescription
--classFunctions15Maximum number of member functions a class can register.
--cppParams8Maximum parameters an OOLua registered C++ member function can have.
--luaParams10Maximum parameters an OOLUA::Lua_function has.
--saveDir./Relative directory to save headers to. Required to be slash postfixed.
--constructorParams5Maximum parameters an OOLua registered C++ constructor can have.


Sign in to add a comment
Powered by Google Project Hosting