mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-11 05:28:35 +00:00
feature-gate vcpkg
This commit is contained in:
parent
5354ba8b04
commit
59b67c14c0
16
.github/workflows/ci.yml
vendored
16
.github/workflows/ci.yml
vendored
@ -136,17 +136,23 @@ jobs:
|
||||
- name: docking feature
|
||||
run: cargo test --workspace --all-targets --features docking
|
||||
|
||||
- name: freetype feature
|
||||
- name: freetype feature (non-Windows, pkg-config)
|
||||
if: matrix.os != 'windows-latest'
|
||||
run: cargo test --workspace --all-targets --features freetype
|
||||
|
||||
- name: all features
|
||||
- name: freetype and docking (non-Windows, pkg-config)
|
||||
if: matrix.os != 'windows-latest'
|
||||
run: cargo test --workspace --all-targets --features docking,freetype
|
||||
run: cargo test --workspace --all-targets --features freetype,docking
|
||||
|
||||
- name: doc tests
|
||||
run: cargo test --workspace --doc
|
||||
- name: freetype feature (Windows, vcpkg)
|
||||
if: matrix.os == 'windows-latest'
|
||||
run: cargo test --workspace --all-targets --features freetype,use-vcpkg
|
||||
|
||||
- name: freetype and docking (Windows, vcpkg)
|
||||
if: matrix.os == 'windows-latest'
|
||||
run: cargo test --workspace --all-targets --features freetype,docking,use-vcpkg
|
||||
|
||||
- run: cargo test --workspace --doc
|
||||
# run to check for lint problems
|
||||
- name: build documentation
|
||||
run: cargo doc
|
||||
|
||||
@ -39,4 +39,5 @@ vcpkg = { version="0.2.15", optional=true }
|
||||
default = []
|
||||
wasm = []
|
||||
docking = []
|
||||
freetype = ["pkg-config", "vcpkg"]
|
||||
freetype = ["pkg-config"]
|
||||
use-vcpkg = ["vcpkg"]
|
||||
|
||||
@ -11,22 +11,16 @@ const DEFINES: &[(&str, Option<&str>)] = &[
|
||||
|
||||
#[cfg(feature = "freetype")]
|
||||
fn find_freetype() -> Vec<impl AsRef<std::path::Path>> {
|
||||
let err_pkg_config;
|
||||
let err_vcpkg;
|
||||
#[cfg(not(feature = "use-vcpkg"))]
|
||||
match pkg_config::Config::new().find("freetype2") {
|
||||
Ok(freetype) => return freetype.include_paths,
|
||||
Err(err) => err_pkg_config = err,
|
||||
Err(err) => panic!("cannot find freetype: {}", err),
|
||||
}
|
||||
#[cfg(feature = "use-vcpkg")]
|
||||
match vcpkg::find_package("freetype") {
|
||||
Ok(freetype) => return freetype.include_paths,
|
||||
Err(err) => err_vcpkg = err,
|
||||
Err(err) => panic!("cannot find freetype: {}", err),
|
||||
}
|
||||
panic!(
|
||||
"cannot find freetype:\n\
|
||||
- pkg-config failed with: {}\n\
|
||||
- vcpkg failed with: {}",
|
||||
err_pkg_config, err_vcpkg
|
||||
);
|
||||
}
|
||||
|
||||
// Output define args for compiler
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user