Skip to content

Commit

Permalink
add windows (MSVC) configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
jkl1337 committed Feb 25, 2024
1 parent 9b245b1 commit 25dfa7c
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/busted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ jobs:
fail-fast: false
matrix:
lua_version: ["luajit-openresty", "luajit-2.1.0-beta3", "luajit-git"]
os: ["ubuntu-latest"]
include:
- lua_version: "5.4.4"
os: "windows-latest"

runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
- name: Setup ‘lua’
uses: jkl1337/gh-actions-lua@master
with:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
/.luarocks
*.pch
*.gch
*.lib
*.so
*.o
*.obj
*.exp
*.dll
.cache/
compile_commands.json
21 changes: 21 additions & 0 deletions Makefile.win
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
T= ljkiwi

OBJS= luakiwi.obj

lib: $T.dll

{luakiwi\}.cpp.obj:
$(CC) $(CFLAGS) /W4 /wd4200 /c /D_CRT_SECURE_NO_DEPRECATE /I. /I kiwi /I"$(LUA_INCDIR)" /EHs /Fo$@ $(CFLAGS) $<

$T.dll: $(OBJS)
link $(LIBFLAG) /out:$T.dll /LIBPATH:"$(LUA_LIBDIR)" "$(LUA_LIBDIR_FILE)" $(OBJS)
IF EXIST $T.dll.manifest mt -manifest $T.dll.manifest -outputresource:$T.dll;2

install: $T.dll
IF NOT EXIST "$(INST_LIBDIR)" mkdir "$(INST_LIBDIR)"
copy $T.dll "$(INST_LIBDIR)"
copy kiwi.lua "$(INST_LUADIR)"

clean:
del $T.dll $(OBJS) $T.lib $T.exp
IF EXIST $T.dll.manifest del $T.dll.manifest
2 changes: 2 additions & 0 deletions kiwi-scm-1.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ build = {
LUA = "$(LUA)",
CFLAGS = "$(CFLAGS)",
LUA_INCDIR = "$(LUA_INCDIR)",
LUA_LIBDIR = "$(LUA_LIBDIR)",
LUA_LIBDIR_FILE = "$(LUA_LIBDIR_FILE)",
LIBFLAG = "$(LIBFLAG)",
LIB_EXT = "$(LIB_EXTENSION)",
OBJ_EXT = "$(OBJ_EXTENSION)",
Expand Down
2 changes: 2 additions & 0 deletions luakiwi/luakiwi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1607,6 +1607,8 @@ void compat_init(lua_State*, int) {}

#if defined __GNUC__ && (!defined _WIN32 || defined __CYGWIN__)
#define LJKIWI_EXPORT __attribute__((__visibility__("default")))
#elif defined _WIN32
#define LJKIWI_EXPORT __declspec(dllexport)
#endif

extern "C" LJKIWI_EXPORT int luaopen_ljkiwi(lua_State* L) {
Expand Down

0 comments on commit 25dfa7c

Please sign in to comment.