forked from bytecodealliance/wasmtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit introduces a wrapper crate which is now the new "real" C API. The purpose of this change is to enable using LTO when building the C API. Currently LTO is disabled because one of the crate types of the C API is an "rlib" which means that it can't have LTO performed due to rustc limitations. The solution here is to remove the "cdylib" and "staticlib" crate types from the "wasmtime-c-api" crate and introduce a new crate 'wasmtime-c-api-artfact' which wraps the previous crate and reexports it. This way LTO can be enabled when just building the artifacts and the use case from bytecodealliance#6765 is still satisfied by having a crate that can be linked to from Rust. Locally this reduces the size of the C API artifact for me by nearly 1M.
- Loading branch information
1 parent
9d8ca82
commit 282d5fd
Showing
6 changed files
with
52 additions
and
14 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
[package] | ||
name = "wasmtime-c-api-artifact" | ||
version.workspace = true | ||
authors.workspace = true | ||
description = "C API to expose the Wasmtime runtime" | ||
license = "Apache-2.0 WITH LLVM-exception" | ||
repository = "https://github.com/bytecodealliance/wasmtime" | ||
readme = "README.md" | ||
edition.workspace = true | ||
publish = false | ||
|
||
[lib] | ||
name = "wasmtime" | ||
crate-type = ["staticlib", "cdylib"] | ||
doc = false | ||
test = false | ||
doctest = false | ||
|
||
[dependencies] | ||
wasmtime-c-api = { path = '..' } | ||
|
||
[features] | ||
default = [ | ||
'profiling', | ||
'wat', | ||
'wasi', | ||
'cache', | ||
'parallel-compilation', | ||
'async', | ||
'coredump', | ||
'addr2line', | ||
] | ||
async = ['wasmtime-c-api/async'] | ||
profiling = ["wasmtime-c-api/profiling"] | ||
cache = ["wasmtime-c-api/cache"] | ||
parallel-compilation = ['wasmtime-c-api/parallel-compilation'] | ||
wasi = ['wasmtime-c-api/wasi'] | ||
logging = ['wasmtime-c-api/logging'] | ||
disable-logging = ["wasmtime-c-api/disable-logging"] | ||
coredump = ["wasmtime-c-api/coredump"] | ||
addr2line = ["wasmtime-c-api/addr2line"] | ||
wat = ["wasmtime-c-api/wat"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub use wasmtime_c_api::*; |