LuaBridge is a lightweight and dependency-free library for mapping data,
functions, and classes back and forth between C++ and Lua (a powerful,
fast, lightweight, embeddable scripting language). LuaBridge has been tested
and works with Lua revisions starting from 5.1.5, although it should work in
any version of Lua from 5.1.0 as well as LuaJit.
clone --recurse-submodules https://github.com/vinniefalco/LuaBridge.git
cd LuaBridge
mkdir build
cd build
cmake -B build # 64-bit version
# or cmake -A Win32 -B build
# Generates MSVS solution build/LuaBridge.sln
Installing LuaBridge (vcpkg)
You can download and install LuaBridge using the vcpkg dependency manager:
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh # The name of the script should be "./bootstrap-vcpkg.bat" for Powershell
./vcpkg integrate install
./vcpkg install luabridge
The LuaBridge port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.
Official Repository
LuaBridge is published under the terms of the MIT License.
The original version of LuaBridge was written by Nathan Reed. The project has
been taken over by Vinnie Falco, who added new functionality, wrote the new
documentation, and incorporated contributions from Nigel Atkinson.
For questions, comments, or bug reports feel free to open a Github issue
or contact Vinnie Falco directly at the email address indicated below.
Portions from The Loki Library:
Copyright (C) 2001 by Andrei Alexandrescu
Older versions of LuaBridge up to and including 0.2 are distributed under the
BSD 3-Clause License. See the corresponding license file in those versions
(distributed separately) for more details.
LuaBridge 2.10
LuaBridge is a lightweight and dependency-free library for mapping data, functions, and classes back and forth between C++ and Lua (a powerful, fast, lightweight, embeddable scripting language). LuaBridge has been tested and works with Lua revisions starting from 5.1.5, although it should work in any version of Lua from 5.1.0 as well as LuaJit.
LuaBridge offers the following features:
Please read the LuaBridge Reference Manual for more details on the API.
Unit Tests
Unit test build requires a CMake and C++11 compliant compiler.
To enable C++17 features (
std::optionalandstd::string_view) specify an extra option:-DLUABRIDGE_CXX17=1.There are the following unit test flavors:
Tests51- uses Lua 5.1.5Tests51Cxx17- uses Lua 5.1.5 and C++17 featuresTests52- uses Lua 5.2.4,Tests52Cxx17- uses Lua 5.2.4 and C++17 featuresTests53- uses Lua 5.3.6Tests53Cxx17- uses Lua 5.3.6 and C++17 featuresTests54- uses Lua 5.4.4Tests54Cxx17- uses Lua 5.4.4 and C++17 featuresBuild using Make on Linux/MacOS/MinGW/WSL2:
Generate XCode project on MacOS:
Generate MSVS solution on Windows:
Installing LuaBridge (vcpkg)
You can download and install LuaBridge using the vcpkg dependency manager:
The LuaBridge port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.
Official Repository
LuaBridge is published under the terms of the MIT License.
The original version of LuaBridge was written by Nathan Reed. The project has been taken over by Vinnie Falco, who added new functionality, wrote the new documentation, and incorporated contributions from Nigel Atkinson.
For questions, comments, or bug reports feel free to open a Github issue or contact Vinnie Falco directly at the email address indicated below.
Copyright 2019, Dmitry Tarakanov
Copyright 2012, Vinnie Falco (<vinnie.falco@gmail.com>)
Copyright 2008, Nigel Atkinson
Copyright 2007, Nathan Reed
Portions from The Loki Library:
Copyright (C) 2001 by Andrei Alexandrescu
Older versions of LuaBridge up to and including 0.2 are distributed under the BSD 3-Clause License. See the corresponding license file in those versions (distributed separately) for more details.