Skip to content

Rinf compiles for armv7 but this stops extism from compiling #344

Answered by temeddix
thejobsmarket asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @thejobsmarket :)

If I remember correctly, dependency crates are loaded and compiled only when you explicitly use them or call them. Therefore, I would suggest you to do something like this:

#[cfg(target_arch = "armv7")]
mod something_with_extism {
    use extism;
    pub some_function () {
        // Do something with extism...
    }
}

#[cfg(not(target_arch = "armv7"))]
mod something_with_extism {
    pub some_function () {
        // Empty placeholder function
    }
}

Below are the list of Rust targets and guides about conditional compilation, just in case:

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by temeddix
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #341 on June 01, 2024 07:28.