Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
32 changes: 16 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ jobs:
matrix:
lua-version:
- "5.1"
- "5.2"
- "5.3"
- "5.4"
- "luajit-2.0.5"
- "luajit-openresty"
# - "5.2"
# - "5.3"
# - "5.4"
# - "luajit-2.0.5"
# - "luajit-openresty"
steps:
-
name: Checkout
Expand All @@ -44,7 +44,7 @@ jobs:
submodules: 'true'
-
name: Setup Lua ${{ matrix.lua-version }}
uses: leafo/gh-actions-lua@v8.0.0
uses: leafo/gh-actions-lua@v8
with:
luaVersion: ${{ matrix.lua-version }}
-
Expand Down Expand Up @@ -76,13 +76,13 @@ jobs:
name: Run Test
run: |
testcase ./test/
# -
# name: Generate coverage reports
# run: |
# sh ./covgen.sh
# -
# name: Upload c coverage to Codecov
# uses: codecov/codecov-action@v2
# with:
# files: ./coverage/lcov.info
# flags: unittests
-
name: Generate coverage reports
run: |
sh ./covgen.sh
-
name: Upload c coverage to Codecov
uses: codecov/codecov-action@v2
with:
files: ./coverage/lcov.info
flags: unittests
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
TARGET=libtls.$(LIB_EXTENSION)
SRCS=$(wildcard src/*.c)
SOBJ=$(SRCS:.c=.$(LIB_EXTENSION))
SUBMOD:=$(filter-out src/$(TARGET),$(SOBJ))
INSTALL?=install

ifdef LIBTLS_COVERAGE
COVFLAGS=--coverage
endif


.PHONY: all install

all: $(SOBJ)

%.o: %.c
$(CC) $(CFLAGS) $(WARNINGS) $(COVFLAGS) $(CPPFLAGS) -o $@ -c $<

%.$(LIB_EXTENSION): %.o
$(CC) -o $@ $^ $(LDFLAGS) $(LIBS) $(PLATFORM_LDFLAGS) $(COVFLAGS)

install:
$(INSTALL) -d $(INST_LIBDIR)
$(INSTALL) src/$(TARGET) $(INST_LIBDIR)
$(INSTALL) -d $(INST_LIBDIR)/libtls
$(INSTALL) $(SUBMOD) $(INST_LIBDIR)/libtls/
rm -f ./src/*.o ./src/*.so ./src/*.gcda

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# lua-libtls

[![test](https://github.com/mah0x211/lua-libtls/actions/workflows/test.yml/badge.svg)](https://github.com/mah0x211/lua-libtls/actions/workflows/test.yml)
[![codecov](https://codecov.io/gh/mah0x211/lua-libtls/branch/master/graph/badge.svg)](https://codecov.io/gh/mah0x211/lua-libtls)


libtls bindings for lua.
Expand Down
44 changes: 14 additions & 30 deletions rockspecs/libtls-3.4.1-3.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,35 +22,19 @@ external_dependencies = {
},
}
build = {
type = "builtin",
modules = {
libtls = {
sources = {
"src/libtls.c",
},
libraries = {
"tls",
},
incdirs = {
"$(LIBTLS_INCDIR)",
},
libdirs = {
"$(LIBTLS_LIBDIR)",
},
},
["libtls.config"] = {
sources = {
"src/config.c",
},
libraries = {
"tls",
},
incdirs = {
"$(LIBTLS_INCDIR)",
},
libdirs = {
"$(LIBTLS_LIBDIR)",
},
},
type = "make",
build_variables = {
SRCDIR = "src",
CFLAGS = "$(CFLAGS)",
WARNINGS = "-Wall -Wno-trigraphs -Wmissing-field-initializers -Wreturn-type -Wmissing-braces -Wparentheses -Wno-switch -Wunused-function -Wunused-label -Wunused-parameter -Wunused-variable -Wunused-value -Wuninitialized -Wunknown-pragmas -Wshadow -Wsign-compare",
CPPFLAGS = "-I$(LUA_INCDIR) -I$(LIBTLS_INCDIR)",
LDFLAGS = "$(LIBFLAG) -L$(LIBTLS_LIBDIR) -ltls",
LIB_EXTENSION = "$(LIB_EXTENSION)",
LIBTLS_COVERAGE = "$(LIBTLS_COVERAGE)",
},
install_variables = {
SRCDIR = "src",
INST_LIBDIR = "$(LIBDIR)",
LIB_EXTENSION = "$(LIB_EXTENSION)",
},
}
44 changes: 14 additions & 30 deletions rockspecs/libtls-scm-1.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,19 @@ external_dependencies = {
},
}
build = {
type = "builtin",
modules = {
libtls = {
sources = {
"src/libtls.c",
},
libraries = {
"tls",
},
incdirs = {
"$(LIBTLS_INCDIR)",
},
libdirs = {
"$(LIBTLS_LIBDIR)",
},
},
["libtls.config"] = {
sources = {
"src/config.c",
},
libraries = {
"tls",
},
incdirs = {
"$(LIBTLS_INCDIR)",
},
libdirs = {
"$(LIBTLS_LIBDIR)",
},
},
type = "make",
build_variables = {
SRCDIR = "src",
CFLAGS = "$(CFLAGS)",
WARNINGS = "-Wall -Wno-trigraphs -Wmissing-field-initializers -Wreturn-type -Wmissing-braces -Wparentheses -Wno-switch -Wunused-function -Wunused-label -Wunused-parameter -Wunused-variable -Wunused-value -Wuninitialized -Wunknown-pragmas -Wshadow -Wsign-compare",
CPPFLAGS = "-I$(LUA_INCDIR) -I$(LIBTLS_INCDIR)",
LDFLAGS = "$(LIBFLAG) -L$(LIBTLS_LIBDIR) -ltls",
LIB_EXTENSION = "$(LIB_EXTENSION)",
LIBTLS_COVERAGE = "$(LIBTLS_COVERAGE)",
},
install_variables = {
SRCDIR = "src",
INST_LIBDIR = "$(LIBDIR)",
LIB_EXTENSION = "$(LIB_EXTENSION)",
},
}