-
Notifications
You must be signed in to change notification settings - Fork 160
/
Makefile
33 lines (21 loc) · 1.22 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# This file is part of ICU4X. For terms of use, please see the file
# called LICENSE at the top level of the ICU4X source tree
# (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
.DEFAULT_GOAL := test
.PHONY: build test
ALL_HEADERS := $(wildcard ../../include/*.hpp) $(wildcard ../../../capi/include/*.h)
ALL_RUST := $(wildcard ../../../capi//src/*.rs)
$(ALL_RUST):
$(ALL_HEADERS):
../../../../target/debug/libicu_capi.a: $(ALL_RUST)
cargo build -p icu_capi
a.out: ../../../../target/debug/libicu_capi.a $(ALL_HEADERS) test.cpp
g++ -std=c++17 test.cpp ../../../../target/debug/libicu_capi.a -ldl -lpthread -lm -g
build: a.out
test: build
./a.out
../../../../target/wasm32-unknown-unknown/debug/libicu_capi.a: $(ALL_RUST)
cargo +nightly build -p icu_capi --target wasm32-unknown-unknown -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort
# Currently this doesn't run successfully, however it's the status quo of compiling ICU4X in C++ to WASM
main.html: ../../../../target/wasm32-unknown-unknown/debug/libicu_capi.a $(ALL_HEADERS) test.cpp
emcc -std=c++17 test.cpp ../../../../target/wasm32-unknown-unknown/debug/libicu_capi.a -ldl -lpthread -lm -DWASM -g -o main.html --emrun -sWASM=1