Skip to content

Commit 229f252

Browse files
committed
gdk: Only build dmabuf API on Linux
1 parent 69df1f2 commit 229f252

File tree

4 files changed

+39
-2
lines changed

4 files changed

+39
-2
lines changed

gdk4/Gir.toml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ generate = [
2828
"Gdk.DevicePad",
2929
"Gdk.DevicePadFeature",
3030
"Gdk.DeviceToolType",
31-
"Gdk.DmabufError",
32-
"Gdk.DmabufTexture",
3331
"Gdk.DNDEvent",
3432
"Gdk.DragAction",
3533
"Gdk.DragCancelReason",
@@ -431,18 +429,30 @@ name = "Gdk.DisplayManager"
431429
status = "generate"
432430
generate_builder = false
433431

432+
[[object]]
433+
name = "Gdk.DmabufError"
434+
status = "generate"
435+
cfg_condition = "target_os = \"linux\""
436+
434437
[[object]]
435438
name = "Gdk.DmabufFormats"
436439
status = "generate"
440+
cfg_condition = "target_os = \"linux\""
437441
[[object.function]]
438442
name = "equal"
439443
[[object.function.parameter]]
440444
name = "formats2"
441445
nullable = false
442446

447+
[[object]]
448+
name = "Gdk.DmabufTexture"
449+
status = "generate"
450+
cfg_condition = "target_os = \"linux\""
451+
443452
[[object]]
444453
name = "Gdk.DmabufTextureBuilder"
445454
status = "generate"
455+
cfg_condition = "target_os = \"linux\""
446456
[[object.function]]
447457
name = "set_update_region"
448458
[[object.function.parameter]]

gdk4/src/auto/enums.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,8 @@ impl From<DeviceToolType> for glib::Value {
601601

602602
#[cfg(feature = "v4_14")]
603603
#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
604+
#[cfg(target_os = "linux")]
605+
#[cfg_attr(docsrs, doc(cfg(target_os = "linux")))]
604606
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
605607
#[non_exhaustive]
606608
#[doc(alias = "GdkDmabufError")]
@@ -617,6 +619,7 @@ pub enum DmabufError {
617619

618620
#[cfg(feature = "v4_14")]
619621
#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
622+
#[cfg(target_os = "linux")]
620623
#[doc(hidden)]
621624
impl IntoGlib for DmabufError {
622625
type GlibType = ffi::GdkDmabufError;
@@ -634,6 +637,7 @@ impl IntoGlib for DmabufError {
634637

635638
#[cfg(feature = "v4_14")]
636639
#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
640+
#[cfg(target_os = "linux")]
637641
#[doc(hidden)]
638642
impl FromGlib<ffi::GdkDmabufError> for DmabufError {
639643
#[inline]
@@ -651,6 +655,7 @@ impl FromGlib<ffi::GdkDmabufError> for DmabufError {
651655

652656
#[cfg(feature = "v4_14")]
653657
#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
658+
#[cfg(target_os = "linux")]
654659
impl glib::error::ErrorDomain for DmabufError {
655660
#[inline]
656661
fn domain() -> glib::Quark {
@@ -676,6 +681,7 @@ impl glib::error::ErrorDomain for DmabufError {
676681

677682
#[cfg(feature = "v4_14")]
678683
#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
684+
#[cfg(target_os = "linux")]
679685
impl StaticType for DmabufError {
680686
#[inline]
681687
#[doc(alias = "gdk_dmabuf_error_get_type")]
@@ -686,6 +692,7 @@ impl StaticType for DmabufError {
686692

687693
#[cfg(feature = "v4_14")]
688694
#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
695+
#[cfg(target_os = "linux")]
689696
impl glib::HasParamSpec for DmabufError {
690697
type ParamSpec = glib::ParamSpecEnum;
691698
type SetValue = Self;
@@ -698,12 +705,14 @@ impl glib::HasParamSpec for DmabufError {
698705

699706
#[cfg(feature = "v4_14")]
700707
#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
708+
#[cfg(target_os = "linux")]
701709
impl glib::value::ValueType for DmabufError {
702710
type Type = Self;
703711
}
704712

705713
#[cfg(feature = "v4_14")]
706714
#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
715+
#[cfg(target_os = "linux")]
707716
unsafe impl<'a> glib::value::FromValue<'a> for DmabufError {
708717
type Checker = glib::value::GenericValueTypeChecker<Self>;
709718

@@ -716,6 +725,7 @@ unsafe impl<'a> glib::value::FromValue<'a> for DmabufError {
716725

717726
#[cfg(feature = "v4_14")]
718727
#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
728+
#[cfg(target_os = "linux")]
719729
impl ToValue for DmabufError {
720730
#[inline]
721731
fn to_value(&self) -> glib::Value {
@@ -734,6 +744,7 @@ impl ToValue for DmabufError {
734744

735745
#[cfg(feature = "v4_14")]
736746
#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
747+
#[cfg(target_os = "linux")]
737748
impl From<DmabufError> for glib::Value {
738749
#[inline]
739750
fn from(v: DmabufError) -> Self {

gdk4/src/auto/mod.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,24 @@ pub use self::display::Display;
5757
mod display_manager;
5858
pub use self::display_manager::DisplayManager;
5959

60+
#[cfg(target_os = "linux")]
61+
#[cfg_attr(docsrs, doc(cfg(target_os = "linux")))]
6062
#[cfg(feature = "v4_14")]
6163
#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
6264
mod dmabuf_texture;
65+
#[cfg(target_os = "linux")]
66+
#[cfg_attr(docsrs, doc(cfg(target_os = "linux")))]
6367
#[cfg(feature = "v4_14")]
6468
#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
6569
pub use self::dmabuf_texture::DmabufTexture;
6670

71+
#[cfg(target_os = "linux")]
72+
#[cfg_attr(docsrs, doc(cfg(target_os = "linux")))]
6773
#[cfg(feature = "v4_14")]
6874
#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
6975
mod dmabuf_texture_builder;
76+
#[cfg(target_os = "linux")]
77+
#[cfg_attr(docsrs, doc(cfg(target_os = "linux")))]
7078
#[cfg(feature = "v4_14")]
7179
#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
7280
pub use self::dmabuf_texture_builder::DmabufTextureBuilder;
@@ -181,9 +189,13 @@ pub use self::content_formats::ContentFormats;
181189
mod content_formats_builder;
182190
pub use self::content_formats_builder::ContentFormatsBuilder;
183191

192+
#[cfg(target_os = "linux")]
193+
#[cfg_attr(docsrs, doc(cfg(target_os = "linux")))]
184194
#[cfg(feature = "v4_14")]
185195
#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
186196
mod dmabuf_formats;
197+
#[cfg(target_os = "linux")]
198+
#[cfg_attr(docsrs, doc(cfg(target_os = "linux")))]
187199
#[cfg(feature = "v4_14")]
188200
#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
189201
pub use self::dmabuf_formats::DmabufFormats;
@@ -230,6 +242,8 @@ pub use self::enums::DevicePadFeature;
230242
pub use self::enums::DeviceToolType;
231243
#[cfg(feature = "v4_14")]
232244
#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
245+
#[cfg(target_os = "linux")]
246+
#[cfg_attr(docsrs, doc(cfg(target_os = "linux")))]
233247
pub use self::enums::DmabufError;
234248
pub use self::enums::DragCancelReason;
235249
pub use self::enums::EventType;

gdk4/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ mod crossing_event;
7878
mod cursor;
7979
mod delete_event;
8080
mod display;
81+
#[cfg(target_os = "linux")]
82+
#[cfg_attr(docsrs, doc(cfg(target_os = "linux")))]
8183
#[cfg(feature = "v4_14")]
8284
#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
8385
mod dmabuf_texture_builder;

0 commit comments

Comments
 (0)