Is there a list of all cfg features?

前端 未结 3 960
太阳男子
太阳男子 2020-12-04 23:03

Rust has the ability to check configuration at build time with, e.g., #[cfg(target_os = \"linux\")] or if cfg!(target_os = \"linux\") {...}, where

3条回答
  •  粉色の甜心
    2020-12-04 23:25

    You can also use this command: rustc --print target-list.

    Each triple are formatted as follows: {arch}-{vendor}-{sys}-{abi}.

    For example, the triple 'arm-unknown-linux-gnueabihf' refers to:

    1. architecture: arm
    2. vendor: unknown. In this case, no vendor was specified.
    3. system: linux
    4. ABI: gnueabihf

提交回复
热议问题