mirror of
https://github.com/cpm-cmake/CPM.cmake.git
synced 2025-11-17 06:37:43 -05:00
* apply clang-format and cmake-format and add style check workflow * add declare package definition * add additional public methods and rename internals * change development verison tag to 1.0.0 * rename internal method * rename public method * rename test var * update copyright and fix comment * typo * run fix-format * fix test function names
17 lines
340 B
C++
17 lines
340 B
C++
#include <cassert>
|
|
#include <sol/sol.hpp>
|
|
|
|
struct vars {
|
|
int boop = 0;
|
|
};
|
|
|
|
int main() {
|
|
sol::state lua;
|
|
lua.open_libraries(sol::lib::base);
|
|
lua.new_usertype<vars>("vars", "boop", &vars::boop);
|
|
lua.script(
|
|
"beep = vars.new()\n"
|
|
"beep.boop = 1\n"
|
|
"print('beep boop')");
|
|
assert(lua.get<vars>("beep").boop == 1);
|
|
} |