Skip to content

Commit

Permalink
more rectify build
Browse files Browse the repository at this point in the history
  • Loading branch information
djellemah committed May 4, 2024
1 parent 1c65e0a commit f8c324c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,14 @@ jobs:
fail-fast: false
matrix:
include:
- target: x86_64-pc-windows-gnu
- target: x86_64-pc-windows-msvc
runs-on: windows-latest
simd-def: RAPIDJSON_SSE42
# - target: x86_64-unknown-linux-musl
# runs-on: ubuntu-latest
- target: x86_64-unknown-linux-gnu
runs-on: ubuntu-latest
simd-def: RAPIDJSON_SSE42
- target: arm64e-apple-darwin
- target: aarch64-apple-darwin
runs-on: macos-latest
simd-def: RAPIDJSON_NEON

runs-on: ${{ matrix.runs-on }}
steps:
Expand All @@ -59,8 +56,6 @@ jobs:
- run: rustup default nightly
- name: compile
run: cargo build --release
env:
${{ matrix.simd-def }}: true

- name: upload bin to release
if: ${{ runner.os != 'Windows' }}
Expand Down
10 changes: 7 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ fn main() {
let define_value = match target_env {
// srsly. There must be a better way.
Ok(s) if s == "x86_64-unknown-linux-gnu" => "#define RAPIDJSON_SSE42".into(),
Ok(s) if s == "x86_64-pc-windows-gnu" => "#define RAPIDJSON_SSE42".into(),
Ok(s) if s == "arm64e-apple-darwin"=> "#define RAPIDJSON_NEON".into(),
wut => format!("// whaddya mean {:?}", wut),
Ok(s) if s == "x86_64-pc-windows-msvc" => "#define RAPIDJSON_SSE42".into(),
Ok(s) if s == "aarch64-apple-darwin" => "#define RAPIDJSON_NEON".into(),
wut => {
let msg = format!("rapidjson SIMD not turned on because we don't know how to do that for target triple {:?}", wut);
println!("cargo::warning={msg}");
format!("// whaddya mean {:?}", wut)
},
};
if option_env!("RAPIDJSON_SSE42").is_some() {
std::fs::write(&dest_path, define_value).unwrap();
Expand Down

0 comments on commit f8c324c

Please sign in to comment.