Fix build on Windows/non-Unix

We'll need libcosmic to work on Windows and macOS if we want to use it
in the Keyboard Configurator.

`freedesktop-icons` doesn't seem to build on Windows, so only use it
on Unix systems. It does seem to build on macOS, so leave it as a
dependency there. A good solution for icon bundling on macOS/Windows will
need to be figured out at some point.
This commit is contained in:
Ian Douglas Scott 2023-04-24 18:15:35 -07:00 committed by Jeremy Soller
parent 93ec06a34d
commit c878e24465
2 changed files with 8 additions and 1 deletions

View file

@ -35,6 +35,7 @@ impl<'a> IconSource<'a> {
let icon: Option<&Path> = match self {
IconSource::Handle(handle) => return handle.clone(),
IconSource::Path(ref path) => Some(path),
#[cfg(unix)]
IconSource::Name(ref name) => {
let icon = crate::settings::DEFAULT_ICON_THEME.with(|default_theme| {
let default_theme: &str = &default_theme.borrow();
@ -56,6 +57,9 @@ impl<'a> IconSource<'a> {
name_path_buffer.as_deref()
}
// TODO: Icon loading mechanism for non-Unix systems
#[cfg(not(unix))]
IconSource::Name(_) => None,
};
let is_svg = svg