Skip to content

Commit

Permalink
working
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Aug 21, 2021
1 parent dcfb108 commit 92eb033
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 13 deletions.
19 changes: 13 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Expand Up @@ -56,3 +56,6 @@ lto = true
[profile.bench]
debug = true
debug-assertions = false

[patch.crates-io]
serde = { path = "../Git/serde/serde" }
2 changes: 1 addition & 1 deletion ffi/capi/Cargo.toml
Expand Up @@ -37,7 +37,7 @@ skip_optional_dependencies = true
denylist = ["bench", "wearos", "freertos", "x86tiny", "smaller_static", "malloc"]

[lib]
crate-type = ["staticlib", "rlib", "cdylib"]
crate-type = ["staticlib"]
path = "src/lib.rs"

[features]
Expand Down
8 changes: 4 additions & 4 deletions ffi/cpp/examples/fixeddecimal_wasm/Makefile
Expand Up @@ -15,11 +15,11 @@ $(ALL_HEADERS):



../../../../target/wasm32-unknown-emscripten/debug/libicu_capi.a: $(ALL_RUST)
cargo +nightly build -p icu_capi --target wasm32-unknown-emscripten -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort
../../../../target/wasm32-unknown-emscripten/release/libicu_capi.a: $(ALL_RUST)
RUSTFLAGS="-Cpanic=abort" cargo +nightly build --release -p icu_capi --target wasm32-unknown-emscripten -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-emscripten/debug/libicu_capi.a $(ALL_HEADERS) test.cpp
emcc -std=c++17 test.cpp ../../../../target/wasm32-unknown-emscripten/debug/libicu_capi.a -ldl -lpthread -lm -g -o main.html --emrun -sWASM=1
main.html: ../../../../target/wasm32-unknown-emscripten/release/libicu_capi.a $(ALL_HEADERS) test.cpp
emcc -std=c++17 test.cpp ../../../../target/wasm32-unknown-emscripten/release/libicu_capi.a -ldl -lpthread -lm -g -o main.html --emrun -sWASM=1

build: main.html
4 changes: 2 additions & 2 deletions ffi/cpp/examples/fixeddecimal_wasm/test.cpp
Expand Up @@ -7,8 +7,8 @@
#include <iostream>

extern "C" void diplomat_init();
extern "C" void trace_js(char* s) {
std::cout<<"TRACE: " <<s <<std::endl;
extern "C" void log_js(char* s) {
std::cout<<"LOG: " <<s <<std::endl;
}

int main() {
Expand Down

0 comments on commit 92eb033

Please sign in to comment.