There are a number of configuration options (preprocessor #defines available when building luabind. It is very important that your project has the exact same configuration options as the ones given when the library was build! The exceptions are the LUABIND_MAX_ARITY and LUABIND_MAX_BASES which are template-based options and only matters when you use the library (which means they can differ from the settings of the library). To achieve this you should use the CMake equivalent of these options. Then, when building with CMake the build_information.hpp header is created and automatically included by config.hpp, thus keeping the options in sync automatically.
If this macro is defined, all the Lua code is expected only to make legal calls. If illegal function calls are made (e.g. giving parameters that doesn’t match the function signature) they will not be detected by luabind and the application will probably crash. Error checking could be disabled when shipping a release build (given that no end-user has access to write custom Lua code). Note that function parameter matching will be done if a function is overloaded, since otherwise it’s impossible to know which one was called. Functions will still be able to throw exceptions when error checking is disabled.
If a function throws an exception it will be caught by luabind and propagated with lua_error().
This define will disable all usage of try, catch and throw in luabind. This will in many cases disable run-time errors, when performing invalid casts or calling Lua functions that fails or returns values that cannot be converted by the given policy. luabind requires that no function called directly or indirectly by luabind throws an exception (throwing exceptions through Lua has undefined behavior).
Where exceptions are the only way to get an error report from luabind, they will be replaced with calls to the callback functions set with set_error_callback() and set_cast_failed_callback().
Must be defined if you intend to link against the luabind shared library (.so or DLL) / build it as such. Note that in future versions of luabind, this option may be dependent on BUILD_SHARED_LIBS in CMake, so you should always set both CMake options to the same value.
If enabling this, you should link Lua dynamically to both Luabind and your application. If you encounter double-free errors or other memory corruption, this might be the problem.
The following options can be given to CMake when building luabind. You can either specify them directly on the commandline using -Doption=value or let CMake ask you for each of them by invoking it with the -i flag. On Windows, you will usually prefer cmake-gui.
All options are booleans, unless specified otherwise.
Enable this for (many) additional compilation tests: Each of Luabind’s public headers will be included in a generated .cpp file which otherwise only contains an empty main function, meaning that one dummy binary per header file is generated.
This can only be enabled if BUILD_TESTING is enabled.