Skip to content

Commit 66db439

Browse files
authored
Merge pull request #1 from tobil4sk/update
Update with latest lua-simdjson changes
2 parents 5033f01 + 70879f5 commit 66db439

19 files changed

Lines changed: 167762 additions & 16555 deletions

.github/workflows/ci.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
lua:
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
os: [linux, macos, macos-arm64]
11+
lua: [lua=5.1, lua=5.2, lua=5.3, lua=5.4, luajit=2.0, luajit=2.1]
12+
include:
13+
- os: linux
14+
runner: ubuntu-22.04
15+
- os: macos
16+
runner: macos-13
17+
- os: macos-arm64
18+
runner: macos-14
19+
exclude:
20+
- os: macos-arm64
21+
lua: luajit=2.0
22+
name: ${{ matrix.os }} (${{ matrix.lua }})
23+
runs-on: ${{ matrix.runner }}
24+
steps:
25+
# Checks-out the repository under $GITHUB_WORKSPACE.
26+
- uses: actions/checkout@v4
27+
- name: Install Lua (${{ matrix.lua }})
28+
run: |
29+
pip install hererocks
30+
hererocks lua_install -r^ --${{ matrix.lua }}
31+
env:
32+
MACOSX_DEPLOYMENT_TARGET: 11.0
33+
- name: Build lua-simdjson
34+
run: |
35+
source lua_install/bin/activate
36+
luarocks make
37+
# - name: Run tests
38+
# run: |
39+
# source lua_install/bin/activate
40+
# luarocks install lua-cjson2
41+
# luarocks install busted
42+
# busted --verbose
43+
44+
windows:
45+
strategy:
46+
fail-fast: false
47+
matrix:
48+
lua: [lua=5.1, lua=5.2, lua=5.3, lua=5.4, luajit=2.0, luajit=2.1]
49+
runs-on: windows-2022
50+
steps:
51+
# Checks-out the repository under $GITHUB_WORKSPACE.
52+
- uses: actions/checkout@v4
53+
- name: Install Lua (${{ matrix.lua }})
54+
run: |
55+
pip install hererocks
56+
hererocks lua_install -r@3a142ce --${{ matrix.lua }}
57+
- name: Build lua-simdjson
58+
run: |
59+
.\lua_install\bin\activate
60+
luarocks make
61+
# - name: Run tests
62+
# run: |
63+
# .\lua_install\bin\activate
64+
# luarocks install lua-cjson2
65+
# luarocks install busted
66+
# busted --verbose

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
test/
22
*.so
3+
*.dll
4+
*.o
5+
*.d
36
*.src.rock

Makefile

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,41 @@
1-
SRC = src/hxluasimdjson.cpp src/simdjson.cpp
2-
INCLUDE = -I$(LUA_INCDIR)
3-
LIBS_PATH = -L$(LUA_LIBDIR)
4-
LIBS = -lpthread
5-
FLAGS = -std=c++11 -Wall $(LIBFLAG) $(CFLAGS)
1+
OBJ = src/hxluasimdjson.o src/simdjson.o
2+
CPPFLAGS = -I$(LUA_INCDIR)
3+
CXXFLAGS = -std=c++11 -Wall $(CFLAGS)
4+
LDFLAGS = $(LIBFLAG)
5+
LDLIBS = -lpthread
66

7-
all: hxsimdjson.so
7+
ifdef LUA_LIBDIR
8+
LDLIBS += $(LUA_LIBDIR)/$(LUALIB)
9+
endif
810

9-
hxsimdjson.so:
10-
$(CXX) $(SRC) $(FLAGS) $(INCLUDE) $(LIBS_PATH) $(LIBS) -o $@
11+
ifeq ($(OS),Windows_NT)
12+
LIBEXT = dll
13+
else
14+
UNAME := $(shell uname -s)
15+
ifeq ($(findstring MINGW,$(UNAME)),MINGW)
16+
LIBEXT = dll
17+
else ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
18+
LIBEXT = dll
19+
else
20+
LIBEXT = so
21+
endif
22+
endif
23+
24+
TARGET = hxsimdjson.$(LIBEXT)
25+
26+
all: $(TARGET)
27+
28+
DEP_FILES = $(OBJ:.o=.d)
29+
-include $(DEP_FILES)
30+
31+
%.o: %.cpp
32+
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -MMD -MP -c $< -o $@
33+
34+
$(TARGET): $(OBJ)
35+
$(CXX) $(LDFLAGS) $^ -o $@ $(LDLIBS)
1136

1237
clean:
13-
rm *.so
38+
rm -f *.$(LIBEXT) src/*.{o,d}
1439

15-
install: hxsimdjson.so
16-
cp hxsimdjson.so $(INST_LIBDIR)
40+
install: $(TARGET)
41+
cp $(TARGET) $(INST_LIBDIR)

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# hx-lua-simdjson (WIP)
1+
# hx-lua-simdjson
2+
3+
[![Build Status](https://github.com/FourierTransformer/lua-simdjson/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/FourierTransformer/lua-simdjson/actions?query=branch%3Amaster)
24

35
A basic haxe-specific lua binding to [simdjson](https://simdjson.org). This
46
library is intended to be used only via the Haxe compiler.
Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package="hx-lua-simdjson"
2-
version="0.0.1-0"
2+
version="0.0.5-1"
33
source = {
4-
url = "git://github.com/jdonaldson/hx-lua-simdjson",
5-
tag = "0.0.2"
4+
url = "git://github.com/HaxeFoundation/hx-lua-simdjson",
5+
tag = "0.0.5"
66
}
77
description = {
88
summary = "This is a simple Haxe-specific Lua binding for simdjson",
99
detailed = [[
1010
This is a Haxe-specific c++ binding to simdjson for parsing JSON very quickly.
1111
]],
12-
homepage = "https://github.com/jdonaldson/hx-lua-simdjson",
12+
homepage = "https://github.com/HaxeFoundation/hx-lua-simdjson",
1313
license = "Apache-2.0"
1414
}
1515
dependencies = {
@@ -20,7 +20,6 @@ build = {
2020
build_variables = {
2121
CFLAGS="$(CFLAGS)",
2222
LIBFLAG="$(LIBFLAG)",
23-
LUA_LIBDIR="$(LUA_LIBDIR)",
2423
LUA_BINDIR="$(LUA_BINDIR)",
2524
LUA_INCDIR="$(LUA_INCDIR)",
2625
LUA="$(LUA)",
@@ -32,4 +31,12 @@ build = {
3231
INST_LUADIR="$(LUADIR)",
3332
INST_CONFDIR="$(CONFDIR)",
3433
},
34+
platforms = {
35+
windows = {
36+
build_variables = {
37+
LUA_LIBDIR="$(LUA_LIBDIR)",
38+
LUALIB="$(LUALIB)",
39+
}
40+
}
41+
}
3542
}

hx-lua-simdjson-scm-0.rockspec

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package="hx-lua-simdjson"
22
version="scm-0"
33
source = {
4-
url = "git://github.com/jdonaldson/hx-lua-simdjson",
4+
url = "git://github.com/HaxeFoudnation/hx-lua-simdjson",
55
tag = "0.0.0"
66
}
77
description = {
88
summary = "This is a simple Haxe-specific Lua binding for simdjson",
99
detailed = [[
1010
This is a Haxe-specific c++ binding to simdjson for parsing JSON very quickly.
1111
]],
12-
homepage = "https://github.com/jdonaldson/hx-lua-simdjson",
12+
homepage = "https://github.com/HaxeFoundation/hx-lua-simdjson",
1313
license = "Apache-2.0"
1414
}
1515
dependencies = {
@@ -20,7 +20,6 @@ build = {
2020
build_variables = {
2121
CFLAGS="$(CFLAGS)",
2222
LIBFLAG="$(LIBFLAG)",
23-
LUA_LIBDIR="$(LUA_LIBDIR)",
2423
LUA_BINDIR="$(LUA_BINDIR)",
2524
LUA_INCDIR="$(LUA_INCDIR)",
2625
LUA="$(LUA)",
@@ -32,4 +31,12 @@ build = {
3231
INST_LUADIR="$(LUADIR)",
3332
INST_CONFDIR="$(CONFDIR)",
3433
},
34+
platforms = {
35+
windows = {
36+
build_variables = {
37+
LUA_LIBDIR="$(LUA_LIBDIR)",
38+
LUALIB="$(LUALIB)",
39+
}
40+
}
41+
}
3542
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
true trailing
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[nil]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nil
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[nully]

0 commit comments

Comments
 (0)