Generate doc for all platforms

Hi all,

I'm writing a crate which is using the windows crate:

[target.'cfg(windows)'.dependencies]
windows = { version = "0.52" , features = ["Win32_Foundation", "Win32_NetworkManagement_IpHelper", "Win32_NetworkManagement_Ndis", "Win32_Networking_WinSock"] }

and 2 modules, one for Unix and the other for Windows. The latter is using some definitions form the windows crate like:

use windows::Win32::{
    Foundation::{ERROR_BUFFER_OVERFLOW, ERROR_INVALID_PARAMETER, ERROR_SUCCESS},
    NetworkManagement::IpHelper::{
        GetAdaptersAddresses, GAA_FLAG_INCLUDE_PREFIX, IP_ADAPTER_ADDRESSES_LH,
    },
    Networking::WinSock::{AF_INET, AF_INET6, AF_UNSPEC, SOCKADDR, SOCKADDR_IN, SOCKADDR_IN6},
};

I want to generate the doc for both platforms. For that I use

#[cfg(any(windows, doc))]
pub mod win;

#[cfg(any(unix, doc))]
pub mod unix;

So cargo doc (inside Linux) works when not using the definitions from the windows crate but fails when using them complaining about the missing windows crate.

How to generate doc for both ?

Thanks a lot for your help !

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.