Thanks to visit codestin.com
Credit goes to github.com

Skip to content
/ lua Public
forked from lua/lua

The Lua repo, as seen by the Lua team. Mirrored irregularly. Please DO NOT send pull requests. Send issues/patches to the Lua mailing list https://www.lua.org/lua-l.html

Notifications You must be signed in to change notification settings

Seng3694/lua

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lua

This is not the official Lua repo. This is a fork with CMake support.

Embedding in CMake project

Example project structure:

project
|-CMakeLists.txt
|-main.c
|-lua

You would probably drop the Lua folder (or submodule) in an appropriate folder. For simplicity I decided not to do that.

cmake_minimum_required(VERSION 2.4)

add_subdirectory(lua)

add_executable(my_project main.c)
target_link_libraries(my_project lua)
target_link_libraries(my_project lauxlib)
target_link_libraries(my_project lualib)

That's all. You can now use the Lua library like you want.

#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>

int main(void)
{
	lua_State* state = luaL_newstate();
	luaL_openlibs(state);
	luaL_dostring(state, "print('lua <3')");
	lua_close(state);
	return 0;
}

Output:

lua <3

About

The Lua repo, as seen by the Lua team. Mirrored irregularly. Please DO NOT send pull requests. Send issues/patches to the Lua mailing list https://www.lua.org/lua-l.html

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 66.2%
  • Lua 30.9%
  • C++ 2.1%
  • Other 0.8%