Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the sm-winit feature on UWP #56

Open
asajeffrey opened this issue Jan 28, 2020 · 5 comments
Open

Using the sm-winit feature on UWP #56

asajeffrey opened this issue Jan 28, 2020 · 5 comments

Comments

@asajeffrey
Copy link

If a user builds with the sm-winit feature on UWP, there's a compile error caused by

/// A placeholder native widget type for UWP, which isn't supported at the moment.
#[cfg(target_vendor = "uwp")]
pub struct NativeWidget;
and
#[cfg(feature = "sm-winit")]
#[inline]
pub fn create_native_widget_from_winit_window(&self, window: &Window)
-> Result<NativeWidget, Error> {
let hwnd = window.get_hwnd() as HWND;
if hwnd.is_null() {
Err(Error::IncompatibleNativeWidget)
} else {
Ok(NativeWidget { window_handle: hwnd })
}
}
. For extra fun, rust-lang/cargo#4463.

@jdm
Copy link

jdm commented Jan 28, 2020

Why are we using sm-winit on UWP?

@asajeffrey
Copy link
Author

Because cargo loves to take the union of features.

@asajeffrey
Copy link
Author

Trying to debug why cargo builds a dep with a feature is painful. Cargo really believes that adding a feature adds functionality.

@jdm
Copy link

jdm commented Jan 28, 2020

@asajeffrey I'm familiar with the cargo union, but confused about why we have uses of surfman that are requesting the sm-winit feature that are outside of ports/glutin.

@asajeffrey
Copy link
Author

Me too. Did rust-lang/cargo#7756 change how features are resolved in workspaces, so the union of features is always taken?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants