Skip to content

Commit

Permalink
Changed the SDL2 path
Browse files Browse the repository at this point in the history
  • Loading branch information
kitao committed Nov 28, 2023
1 parent 5fc823d commit d2730cc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,14 @@ jobs:
CFLAGS="-O3 -fPIC" ./configure \
--build=x86_64-unknown-linux-gnu \
--host=${{ matrix.target }} \
--prefix=$(pwd)/SDL2-build
make -j4
make install
cd ..
rm -rf SDL2-${SDL2_VERSION}
- name: Build wheels
run: |
export RUSTFLAGS="-I/usr/${{ matrix.target }}/include -L/usr/${{ matrix.target }}/lib"
export RUSTFLAGS="-L/usr/${{ matrix.target }}/lib"
make TARGET=${{ matrix.target }}
- name: Upload wheels
Expand Down
12 changes: 12 additions & 0 deletions crates/pyxel-platform/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,18 @@ impl SDL2BindingsBuilder {
.unwrap();
include_paths.push(format!("-I{}", sdl2_include_path));
include_paths.push(format!("-I{}/..", sdl2_include_path));
} else {
let output = Command::new("sdl2-config")
.arg("--cflags")
.output()
.expect("Failed to execute sdl2-config");
let cflags = str::from_utf8(&output.stdout).unwrap();
let sdl2_include_paths = cflags
.split_whitespace()
.filter(|cflag| cflag.starts_with("-I"))
.map(|cflag| cflag[2..].to_string())
.collect::<Vec<String>>();
include_paths.extend(sdl2_include_paths);
}
include_paths
}
Expand Down

0 comments on commit d2730cc

Please sign in to comment.