Fix Wasm build

This commit is contained in:
Ingvar Stepanyan
2023-08-05 19:21:03 +01:00
parent c80c04f006
commit 6c693186c2
4 changed files with 7 additions and 10 deletions

5
.gitignore vendored
View File

@@ -3,7 +3,4 @@ node_modules
/deps/* /deps/*
!/deps/libgphoto2 !/deps/libgphoto2
!/deps/libusb !/deps/libusb
/api.o /src/api.o
# Local Netlify folder
.netlify

3
.gitmodules vendored
View File

@@ -4,5 +4,4 @@
branch = em branch = em
[submodule "libusb"] [submodule "libusb"]
path = deps/libusb path = deps/libusb
url = https://github.com/RReverser/libusb url = https://github.com/libusb/libusb
branch = em

View File

@@ -5,7 +5,7 @@ export LDFLAGS += -L$(SYSROOT)/lib
export ACLOCAL_PATH := $(SYSROOT)/share/aclocal:$(ACLOCAL_PATH) export ACLOCAL_PATH := $(SYSROOT)/share/aclocal:$(ACLOCAL_PATH)
# Common linking flags for all targets. # Common linking flags for all targets.
export LDFLAGS += -s DYNAMIC_EXECUTION=0 -s AUTO_JS_LIBRARIES=0 -s AUTO_NATIVE_LIBRARIES=0 -s ENVIRONMENT=web,worker export LDFLAGS += -s DYNAMIC_EXECUTION=0 -s AUTO_JS_LIBRARIES=0 -s AUTO_NATIVE_LIBRARIES=0
# Common compilation & linking flags for all langs and targets. # Common compilation & linking flags for all langs and targets.
COMMON_FLAGS = -Os -flto COMMON_FLAGS = -Os -flto
@@ -17,7 +17,7 @@ export LDFLAGS += $(COMMON_FLAGS)
build/libapi.mjs: src/api.o $(SYSROOT)/lib/libltdl.la $(SYSROOT)/lib/libgphoto2.la build/libapi.mjs: src/api.o $(SYSROOT)/lib/libltdl.la $(SYSROOT)/lib/libgphoto2.la
libtool --verbose --mode=link $(LD) $(LDFLAGS) -o $@ $+ \ libtool --verbose --mode=link $(LD) $(LDFLAGS) -o $@ $+ \
-fexceptions --bind -s ASYNCIFY -s ALLOW_MEMORY_GROWTH \ -fexceptions --bind -s ASYNCIFY -s ALLOW_MEMORY_GROWTH -s ENVIRONMENT=web,worker \
-dlpreopen $(SYSROOT)/lib/libgphoto2/2.5.28.1/ptp2.la \ -dlpreopen $(SYSROOT)/lib/libgphoto2/2.5.28.1/ptp2.la \
-dlpreopen $(SYSROOT)/lib/libgphoto2_port/0.12.0/usb1.la -dlpreopen $(SYSROOT)/lib/libgphoto2_port/0.12.0/usb1.la

View File

@@ -2,8 +2,9 @@
"name": "web-gphoto2", "name": "web-gphoto2",
"version": "0.1.0", "version": "0.1.0",
"description": "WebAssembly implementation of gphoto2 and libusb to control DSLR cameras over USB on the Web", "description": "WebAssembly implementation of gphoto2 and libusb to control DSLR cameras over USB on the Web",
"type": "module", "exports": {
"main": "build/camera.js", "import": "./build/camera.js"
},
"types": "build/camera.d.ts", "types": "build/camera.d.ts",
"scripts": { "scripts": {
"build:ts": "tsc" "build:ts": "tsc"