Skip to content

Commit

Permalink
makefile: separate out type definition move (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
wydengyre authored Jun 15, 2024
1 parent e5bd6f9 commit 9ad0b8e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ checkformat:
node_modules/.bin/prettier --check {src,test}/**/*.js

.PHONY: typecheck
typecheck:
typecheck: build/tesseract-core.d.ts
node_modules/.bin/tsc

.PHONY: test
Expand Down Expand Up @@ -164,7 +164,6 @@ build/tesseract-core.js build/tesseract-core.wasm: src/lib.cpp src/tesseract-ini
$(EMSDK_DIR)/emcc src/lib.cpp $(EMCC_FLAGS) \
-I$(INSTALL_DIR)/include/ -L$(INSTALL_DIR)/lib/ -ltesseract -lleptonica -lembind \
-o build/tesseract-core.js
cp src/tesseract-core.d.ts build/

# Build fallback WASM binary for browsers that don't support WASM SIMD. The JS
# output from this build is not used.
Expand All @@ -173,6 +172,9 @@ build/tesseract-core-fallback.js build/tesseract-core-fallback.wasm: src/lib.cpp
-I$(INSTALL_DIR)/include/ -L$(FALLBACK_INSTALL_DIR)/lib/ -L$(INSTALL_DIR)/lib -ltesseract -lleptonica -lembind \
-o build/tesseract-core-fallback.js

build/tesseract-core.d.ts: src/tesseract-core.d.ts build
cp $< $@

dist/tesseract-core.wasm: build/tesseract-core.wasm
mkdir -p dist/
cp $< $@
Expand Down
1 change: 0 additions & 1 deletion src/ocr-engine.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-ignore - Don't error if library hasn't been built yet.
import initTesseractCore from "../build/tesseract-core";

import { imageDataFromBitmap } from "./utils";
Expand Down

0 comments on commit 9ad0b8e

Please sign in to comment.