Skip to content

Commit

Permalink
Set CARGO_BUILD_TARGET; add CMakeLists to package
Browse files Browse the repository at this point in the history
  • Loading branch information
CGamesPlay committed Aug 1, 2024
1 parent 4328084 commit 560b2a0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,16 @@ jobs:
- run: |
rustup component add rust-src
rustup target add ${{ matrix.target }}
# Update binutils if MinGW due to https://github.com/rust-lang/rust/issues/112368
- run: C:/msys64/usr/bin/pacman.exe -S --needed mingw-w64-x86_64-gcc --noconfirm
if: matrix.target == 'x86_64-pc-windows-gnu'
- shell: pwsh
run: |
echo "C:\msys64\mingw64\bin" >> $Env:GITHUB_PATH
echo "CC=gcc" >> $Env:GITHUB_ENV
echo "CXX=g++" >> $Env:GITHUB_ENV
if: matrix.target == 'x86_64-pc-windows-gnu'


# On one builder produce the source tarball since there's no need to produce
# it everywhere
Expand All @@ -1096,13 +1106,6 @@ jobs:
with:
target: ${{ matrix.target }}

# Update binutils if MinGW due to https://github.com/rust-lang/rust/issues/112368
- run: C:/msys64/usr/bin/pacman.exe -S --needed mingw-w64-x86_64-gcc --noconfirm
if: matrix.target == 'x86_64-pc-windows-gnu'
- shell: pwsh
run: echo "C:\msys64\mingw64\bin" >> $Env:GITHUB_PATH
if: matrix.target == 'x86_64-pc-windows-gnu'

- run: $CENTOS ./ci/build-release-artifacts.sh "${{ matrix.build }}" "${{ matrix.target }}"

# Assemble release artifacts appropriate for this platform, then upload them
Expand Down
3 changes: 3 additions & 0 deletions crates/c-api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ find_program(WASMTIME_CARGO_BINARY cargo)
if(NOT WASMTIME_CARGO_BINARY)
message(FATAL_ERROR [["cargo" was not found. Ensure "cargo" is in PATH. Aborting...]])
endif()
# Note: this line will *always* create ${CMAKE_CURRENT_SOURCE_DIR}/artifact
# during the configure stage of cmake, and there does not seem to be a way to
# disable this behavior. This prevents cargo package from verifying the package.
ExternalProject_Add(
wasmtime-crate
DOWNLOAD_COMMAND ""
Expand Down
2 changes: 1 addition & 1 deletion crates/c-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repository = "https://github.com/bytecodealliance/wasmtime"
readme = "README.md"
edition.workspace = true
links = "wasmtime-c-api"
include = ["include", "src", "build.rs"]
include = ["include", "src", "build.rs", "CMakeLists.txt", "doxygen.conf.in"]

[lints]
workspace = true
Expand Down
2 changes: 2 additions & 0 deletions scripts/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,8 @@ fn verify(crates: &[Crate]) {
.env("CARGO_TARGET_DIR", "./target");
if krate.name.contains("wasi-nn") {
cmd.arg("--no-verify");
} else if krate.name == "wasmtime-c-api-impl" {
cmd.arg("--no-verify");
}
run_cmd(&mut cmd);
run_cmd(
Expand Down

0 comments on commit 560b2a0

Please sign in to comment.