Skip to content

Commit f442a53

Browse files
committed
make: split global linker and compile flags
Future emscripten versions warn if link-only options are set during compilation.
1 parent cb860de commit f442a53

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
BASE_DIR:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
55
DIST_DIR:=$(BASE_DIR)dist/libraries
66

7-
GLOBAL_CFLAGS:=-O3 -s ENVIRONMENT=web,webview
7+
GLOBAL_CFLAGS:=-O3
8+
GLOBAL_LDFLAGS:=-s ENVIRONMENT=web,webview
9+
export LDFLAGS = $(GLOBAL_LDFLAGS)
810

911
all: subtitleoctopus
1012

@@ -158,7 +160,6 @@ $(DIST_DIR)/lib/libharfbuzz.a: build/lib/freetype/build_hb/dist_hb/lib/libfreety
158160
-s NO_EXIT_RUNTIME=1 \
159161
-s MODULARIZE=1 \
160162
" \
161-
LDFLAGS="" \
162163
--prefix="$(DIST_DIR)" \
163164
--host=x86-none-linux \
164165
--build=x86_64 \
@@ -292,7 +293,7 @@ src/subtitles-octopus-worker.bc: $(OCTP_DEPS) src/Makefile src/SubtitleOctopus.c
292293

293294
# Dist Files
294295
EMCC_COMMON_ARGS = \
295-
$(GLOBAL_CFLAGS) \
296+
$(GLOBAL_LDFLAGS) \
296297
-s EXPORTED_FUNCTIONS="['_main', '_malloc']" \
297298
-s EXPORTED_RUNTIME_METHODS="['ccall', 'cwrap', 'getValue', 'FS_createPreloadedFile', 'FS_createPath']" \
298299
-s NO_EXIT_RUNTIME=1 \

0 commit comments

Comments
 (0)