4 ms·
Will this work when cross-compiling from Linux? That's supported by Rust.
by Animats 6y ago
Will this work when cross-compiling from Linux? That's supported by Rust.
- monocasa 6y agoI don't see why not, the winapi crate is.
- roblabla 6y agoThe winapi does a lot of work to support that use-case. Importantly, it ships (mingw) import libraries to allow linking against windows libs from linux trivially[0]. EDIT: windows-rs doesn't yet support cross compilation as easily as winapi. Here's the issue tracking it: https://github.com/microsoft/windows-rs/issues/142 https://github.com/microsoft/windows-rs/issues/142 [0]: https://github.com/retep998/winapi-rs/tree/0.3/x86_64/def https://github.com/retep998/winapi-rs/tree/0.3/x86_64/def
- Arnavion 6y agoThe question is valid. The winapi crate binds the functions in the Windows headers explicitly. You can call `winapi::...::CreateEventW` because winapi has a `pub extern unsafe fn CreateEventW(...)` in its code. This new crate is a generator. If this new generator requires access to the .winmd files or .h files from the SDK or whatever, where is the non-Windows builder going to get those from? And will this generator look for them there? For example, I used to maintain a generator that took COM typelibs and generated Rust bindings for them, but it required calling into the Windows API for working with typelibs and thus obviously required a Windows builder. The functionality of this crate is split between the windows_gen and windows_macros crates, and from a cursory glance I could not tell how it works wrt win32 bindings. Edit: Answered by https://news.ycombinator.com/item?id=25863581 https://news.ycombinator.com/item?id=25863581 - the win32 API is now also described by .winmd files. So the question is, can a non-Windows builder get these files, and then convince this crate to look for them wherever it placed them?
- dguaraglia 6y ago> This new crate is a generator. If this new generator requires access to the .winmd files or .h files from the SDK or whatever, where is the non-Windows builder going to get those from? And will this generator look for them there? From memory (I haven't done Windows development in forever): there's a few projects that try to provide an open source version of the Windows API headers. The MingW project, for example, has a full set of drop-in replacement headers (meaning you can take code that compiled with Visual C++ and compile it directly with MingW's GCC and it should 'just work'). The LCC-Win64 project has a similar set of headers. Does that answer your question?
- Arnavion 6y agoHeaders are irrelevant. We're talking about .winmd files.
- orra 6y ago> So the question is, can a non-Windows builder get these files, and then convince this crate to look for them wherever it placed them? Yes, there's actually a prebuilt Windows.Win32.winmd file in the repo, underneath .windows/.
- est31 6y agohttps://github.com/microsoft/windows-rs/issues/143#issuecomment-629701676 https://github.com/microsoft/windows-rs/issues/143#issuecomm... > we could support this in future, but it is not an immediate goal. If this is something that folks would like to do, feel free to chime in on this issue and let us know. Note that most of Microsoft regards Linux mainly as a server OS. You are not supposed to use it on the desktop, instead you should use Windows there.
- reader_mode 6y agoEven if that's true you really don't want to run a Windows box as a build server - licensing and security and all that.
- pjmlp 6y agoI have a CentOS DVD to offer you.
- phkahler 6y ago>> Note that most of Microsoft regards Linux mainly as a server OS. You are not supposed to use it on the desktop, instead you should use Windows there. Then what's the point of WSL? To allow server software development on a Windows desktop? OK. But then what's the point of trying to bring DX graphics to linux?