Skip to content

[cmake]:implement CMake build for NuttX Lua interpreter#2567

Merged
xiaoxiang781216 merged 1 commit intoapache:masterfrom
xuxin930:cmake-lua
Sep 13, 2024
Merged

[cmake]:implement CMake build for NuttX Lua interpreter#2567
xiaoxiang781216 merged 1 commit intoapache:masterfrom
xuxin930:cmake-lua

Conversation

@xuxin930
Copy link
Contributor

Summary

add CMake module for register lua mod

# example in luamod CMakeLists.txt

nuttx_add_luamod(MODS hello)
nsh> lua
Lua 5.4.0  Copyright (C) 1994-2020 Lua.org, PUC-Rio
> hello.say_hello()
Hello World!
> io.write("abs is =",math.abs(-10),"\n")
abs is =10
> os.exit()
nsh>

Impact

Testing

CI

add CMake module for register lua mod
nsh> lua
Lua 5.4.0  Copyright (C) 1994-2020 Lua.org, PUC-Rio
> hello.say_hello()
Hello World!
> io.write("abs is =",math.abs(-10),"\n")
abs is =10
> os.exit()
nsh>

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
Copy link
Contributor

@cederom cederom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @xuxin930 :-)

@xiaoxiang781216 xiaoxiang781216 merged commit 3d8dc5d into apache:master Sep 13, 2024
@yamt
Copy link
Contributor

yamt commented Dec 17, 2024

nsh> lua
Lua 5.4.0  Copyright (C) 1994-2020 Lua.org, PUC-Rio
> hello.say_hello()
Hello World!
> io.write("abs is =",math.abs(-10),"\n")
abs is =10
> os.exit()
nsh>

are you using some uncommitted changes?
nuttx_linit.c doesn't seem to register os or io.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants