Skip to content

Commit c37e273

Browse files
authored
feat: Add ucrt64 support in makefile (#455)
1 parent 138f06e commit c37e273

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# print print the build settings
1111

1212
PLAT?= linux
13-
PLATS= macosx linux win32 win64 mingw freebsd solaris
13+
PLATS= macosx linux win32 win64 mingw freebsd solaris ucrt64
1414

1515
all: $(PLAT)
1616

src/makefile

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ LUAPREFIX_mingw?=/usr
7474
CDIR_mingw?=lua/$(LUAV)
7575
LDIR_mingw?=lua/$(LUAV)/lua
7676

77+
# where lua headers are found for ucrt64 builds
78+
# LUAINC_ucrt64:
79+
LUAINC_ucrt64?=/ucrt64/include
80+
LUALIB_ucrt64?=/ucrt64/bin/lua$(subst .,,$(LUAV)).dll
81+
LUAPREFIX_ucrt64?=/ucrt64
82+
CDIR_ucrt64?=lib/lua/$(LUAV)
83+
LDIR_ucrt64?=share/lua/$(LUAV)
7784

7885
# LUAINC_win32:
7986
# LUALIB_win32:
@@ -153,7 +160,7 @@ print:
153160
#------
154161
# Supported platforms
155162
#
156-
PLATS= macosx linux win32 win64 mingw solaris
163+
PLATS= macosx linux win32 win64 mingw solaris ucrt64
157164

158165
#------
159166
# Compiler and linker settings
@@ -219,6 +226,21 @@ LDFLAGS_mingw= $(LUALIB) -shared -Wl,-s -lws2_32 -o
219226
LD_mingw=gcc
220227
SOCKET_mingw=wsocket.o
221228

229+
#------
230+
# Compiler and linker settings
231+
# for ucrt64
232+
SO_ucrt64=dll
233+
O_ucrt64=o
234+
CC_ucrt64=gcc
235+
DEF_ucrt64= -DLUASOCKET_$(DEBUG) \
236+
-DWINVER=0x0501
237+
CFLAGS_ucrt64= -I$(LUAINC) $(DEF) -Wall -O2 -fno-common
238+
# \
239+
-fvisibility=hidden
240+
LDFLAGS_ucrt64= $(LUALIB) -shared -Wl,-s -lws2_32 -o
241+
LD_ucrt64=gcc
242+
SOCKET_ucrt64=wsocket.o
243+
222244

223245
#------
224246
# Compiler and linker settings
@@ -384,6 +406,9 @@ linux:
384406
mingw:
385407
$(MAKE) all PLAT=mingw
386408

409+
ucrt64:
410+
$(MAKE) all PLAT=ucrt64
411+
387412
solaris:
388413
$(MAKE) all-unix PLAT=solaris
389414

0 commit comments

Comments
 (0)