Skip to content

Make it build for wasm32-wasi#1289

Closed
Maaarcocr wants to merge 1 commit intorusqlite:masterfrom
Maaarcocr:master
Closed

Make it build for wasm32-wasi#1289
Maaarcocr wants to merge 1 commit intorusqlite:masterfrom
Maaarcocr:master

Conversation

@Maaarcocr
Copy link

CARGO_CFG_TARGET_ENV is not being set when compiling to wasm32-wasi and if it isn't then the flags used for compiling sqlite correctly for it do not get applied. We can use TARGET instead, which seems to be always set.

Also, -DSQLITE_THREADSAFE=0 is needed as a flag, as without it, sqlite will use pthread.h which is not defined for wasi targets.

/// See [`win_target`]
fn is_compiler(compiler_name: &str) -> bool {
env::var("CARGO_CFG_TARGET_ENV").map_or(false, |v| v == compiler_name)
env::var("TARGET").map_or(false, |v| v == compiler_name)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure but for me this changes breaks cross compilation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants