mirror of
https://github.com/google/liblc3.git
synced 2026-06-19 17:12:29 +00:00
wasm: Add a wasm liblc3 library
The wasm library is automatically built when the compiler target is set to wasm32 in bin/liblc3.wasm. This can be done using `make CC="clang --target=wasm32"`. This wasm library doesn't have any import and expose all liblc3 functions.
This commit is contained in:
committed by
Antoine SOULIER
parent
d7a739849a
commit
e67bb2d07d
@@ -33,6 +33,16 @@ LDFLAGS := $(if $(DEBUG),-O0 -g,-O3)
|
||||
|
||||
CFLAGS += -std=c11 -Wall -Wextra -Wdouble-promotion -Wvla -pedantic
|
||||
|
||||
TARGET = $(lastword $(shell $(CC) -v 2>&1 | grep "Target: "))
|
||||
|
||||
LIB_SUFFIX := so
|
||||
|
||||
ifeq ($(TARGET),wasm32)
|
||||
LIB_SUFFIX := wasm
|
||||
CFLAGS += -mbulk-memory
|
||||
LDFLAGS += -nostdlib -Wl,--no-entry -Wl,--export-dynamic
|
||||
endif
|
||||
|
||||
ifneq ($(LC3_PLUS),)
|
||||
DEFINE += LC3_PLUS=$(LC3_PLUS)
|
||||
endif
|
||||
@@ -50,7 +60,7 @@ lib_list :=
|
||||
bin_list :=
|
||||
|
||||
define add-lib
|
||||
$(eval $(1)_bin ?= $(1).so)
|
||||
$(eval $(1)_bin ?= $(1).$(LIB_SUFFIX))
|
||||
$(eval $(1)_bin := $(addprefix $(BIN_DIR)/,$($(1)_bin)))
|
||||
|
||||
lib_list += $(1)
|
||||
|
||||
Reference in New Issue
Block a user