Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions tools/ports/contrib/lua.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
LICENSE = 'MIT License'

port_name = 'contrib.lua'
lib_name = 'liblua.a'
lib_name = 'liblua'


def get(ports, settings, shared):
Expand All @@ -36,10 +36,15 @@ def create(final):
ldblib.c liolib.c lmathlib.c loadlib.c loslib.c lstrlib.c ltablib.c lutf8lib.c linit.c
'''.split()

ports.build_port(source_path, final, port_name, srcs=srcs)
flags=[]

return [shared.cache.get_lib(lib_name, create, what='port')]
if settings.PTHREADS:
flags += ['-pthread']

ports.build_port(source_path, final, port_name, srcs=srcs, flags=flags)

return [shared.cache.get_lib(lib_name + ('-mt' if settings.PTHREADS else '') + '.a', create, what='port')]


def clear(ports, settings, shared):
shared.cache.erase_lib(lib_name)
shared.cache.erase_lib(lib_name + ('-mt' if settings.PTHREADS else '') + '.a')
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The convention is to add get_lib_name function.

You will also want to add a variants mapping so that embuilder can build the different variants.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

yeah, i fixed it, thanks
and also fixed the name of the issue