Skip to content

Commit

Permalink
fix build script on gnu environment (#96)
Browse files Browse the repository at this point in the history
Co-authored-by: vincent <[email protected]>
  • Loading branch information
vinxv and vincent authored Dec 1, 2024
1 parent ff6bfb4 commit dc6eef7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
28 changes: 17 additions & 11 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- dev
pull_request:
workflow_dispatch:

Expand All @@ -18,7 +19,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
submodules: "recursive"
fetch-depth: 500
- uses: dtolnay/rust-toolchain@stable
- run: cargo check
Expand All @@ -33,7 +34,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
submodules: "recursive"
fetch-depth: 500
- uses: dtolnay/rust-toolchain@stable
- name: Install LLVM
Expand All @@ -52,36 +53,41 @@ jobs:
- name: Test package mupdf-sys
if: matrix.os == 'ubuntu-latest'
run: cargo package --manifest-path mupdf-sys/Cargo.toml

test-msys:
name: Test Suite (MSYS2)
runs-on: windows-2019
defaults:
run:
shell: msys2 {0}
strategy:
matrix:
include:
- { sys: ucrt64, env: ucrt-x86_64 }
- { sys: ucrt64, env: ucrt-x86_64 }
- { sys: mingw64, env: x86_64 }
# - { sys: mingw32, env: i686 }
- { sys: mingw32, env: i686 }
- { sys: clang64, env: clang-x86_64 }
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
install: mingw-w64-${{matrix.env}}-rust base base-devel unzip git
install: mingw-w64-${{matrix.env}}-rust mingw-w64-${{matrix.env}}-clang base base-devel unzip git

- uses: actions/checkout@v3
with:
submodules: 'recursive'
submodules: "recursive"
fetch-depth: 500
- run: cargo test

- run: |
rustc --version --verbose
cargo test
asan:
name: Address Sanitizer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
submodules: "recursive"
fetch-depth: 500
- uses: dtolnay/rust-toolchain@nightly
with:
Expand All @@ -98,7 +104,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
submodules: "recursive"
fetch-depth: 500
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@valgrind
Expand Down
6 changes: 3 additions & 3 deletions mupdf-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ fn build_libmupdf() {
let mut make_flags = vec![
"libs".to_owned(),
format!("build={}", profile),
format!("OUT={}", build_dir.display()),
format!("OUT={}", &build_dir_str),
#[cfg(feature = "sys-lib-freetype")]
"USE_SYSTEM_FREETYPE=yes".to_owned(),
#[cfg(feature = "sys-lib-gumbo")]
Expand Down Expand Up @@ -253,15 +253,15 @@ fn build_libmupdf() {
};
let output = Command::new(make)
.args(&make_flags)
.current_dir(&build_dir)
.current_dir(&build_dir_str)
.stdout(Stdio::inherit())
.stderr(Stdio::inherit())
.output()
.expect("make failed");
if !output.status.success() {
panic!("Build error, exit code {}", output.status.code().unwrap());
}
println!("cargo:rustc-link-search=native={}", build_dir.display());
println!("cargo:rustc-link-search=native={}", &build_dir_str);
println!("cargo:rustc-link-lib=static=mupdf");
// println!("cargo:rustc-link-lib=static=mupdf-pkcs7");
println!("cargo:rustc-link-lib=static=mupdf-third");
Expand Down

0 comments on commit dc6eef7

Please sign in to comment.