Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web version builds into libraylib.a #161

Open
InfiniteCoder01 opened this issue Jul 7, 2023 · 0 comments
Open

Web version builds into libraylib.a #161

InfiniteCoder01 opened this issue Jul 7, 2023 · 0 comments

Comments

@InfiniteCoder01
Copy link

InfiniteCoder01 commented Jul 7, 2023

Hello!

I'm using raylib-rs v3.7.0.

In raylib-sys/build.rs there is this:

// on web copy libraylib.bc to libraylib.a
if platform == Platform::Web {
    std::fs::copy(dst_lib.join("libraylib.bc"), dst_lib.join("libraylib.a"))
        .expect("filed to create wasm library");
}

But for some reason, on my system (6.1.31-2-MANJARO (64-bit)), with command cargo build --target=wasm32-unknown-emscripten it builds into "libraylib.a".

I suggest doing this:

// on web copy libraylib.bc to libraylib.a (if exists)
if platform == Platform::Web {
    if dst_lib.join("libraylib.bc").exists() {
        std::fs::copy(dst_lib.join("libraylib.bc"), dst_lib.join("libraylib.a"))
            .expect("filed to create wasm library");
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant