Skip to content

Commit a8dff99

Browse files
Protect makefile when LUA_LIBDIR is not available
1 parent 56ac8bf commit a8dff99

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

rock.mk

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ CC ?= gcc
1414
PLAT ?= windows
1515
LIBNAME = webview
1616

17+
ifdef LUA_LIBDIR
18+
LUA_LIBDIR_OPT=-L$(LUA_LIBDIR)
19+
else
20+
LUA_LIBDIR_OPT=
21+
endif
22+
1723
#LUA_APP = $(LUA_BINDIR)/$(LUA)
1824
LUA_APP = $(LUA)
1925
LUA_VERSION = $(shell $(LUA_APP) -e "print(string.sub(_VERSION, 5))")
@@ -40,7 +46,7 @@ CFLAGS_windows = -Wall \
4046
LIBFLAG_windows = -O \
4147
-shared \
4248
-Wl,-s \
43-
-L$(LUA_LIBDIR) -l$(LUA_LIBNAME) \
49+
$(LUA_LIBDIR_OPT) -l$(LUA_LIBNAME) \
4450
-static-libgcc \
4551
-lole32 -lcomctl32 -loleaut32 -luuid -lgdi32
4652

@@ -58,7 +64,7 @@ CFLAGS_linux = -pedantic \
5864

5965
LIBFLAG_linux= -static-libgcc \
6066
-Wl,-s \
61-
-L$(LUA_LIBDIR) \
67+
$(LUA_LIBDIR_OPT) \
6268
$(shell pkg-config --libs gtk+-3.0 webkit2gtk-4.0)
6369

6470
TARGET_linux = $(LIBNAME).so

0 commit comments

Comments
 (0)