Fix Wasm build
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -3,7 +3,4 @@ node_modules
|
||||
/deps/*
|
||||
!/deps/libgphoto2
|
||||
!/deps/libusb
|
||||
/api.o
|
||||
|
||||
# Local Netlify folder
|
||||
.netlify
|
||||
/src/api.o
|
||||
|
||||
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -4,5 +4,4 @@
|
||||
branch = em
|
||||
[submodule "libusb"]
|
||||
path = deps/libusb
|
||||
url = https://github.com/RReverser/libusb
|
||||
branch = em
|
||||
url = https://github.com/libusb/libusb
|
||||
|
||||
4
Makefile
4
Makefile
@@ -5,7 +5,7 @@ export LDFLAGS += -L$(SYSROOT)/lib
|
||||
export ACLOCAL_PATH := $(SYSROOT)/share/aclocal:$(ACLOCAL_PATH)
|
||||
|
||||
# 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_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
|
||||
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_port/0.12.0/usb1.la
|
||||
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
"name": "web-gphoto2",
|
||||
"version": "0.1.0",
|
||||
"description": "WebAssembly implementation of gphoto2 and libusb to control DSLR cameras over USB on the Web",
|
||||
"type": "module",
|
||||
"main": "build/camera.js",
|
||||
"exports": {
|
||||
"import": "./build/camera.js"
|
||||
},
|
||||
"types": "build/camera.d.ts",
|
||||
"scripts": {
|
||||
"build:ts": "tsc"
|
||||
|
||||
Reference in New Issue
Block a user