baoyachi / shadow-rs

A build-time information stored in your rust project.(binary,lib,cdylib,dylib)
https://docs.rs/shadow-rs
MIT License
475 stars 41 forks source link

Detect target features #69

Closed epage closed 2 years ago

epage commented 2 years ago

In clap, we have https://github.com/clap-rs/clap/issues/1363. I'm tempted to close this out by pointing to shadow. One thing mentioned in that issue but that I'm not seeing in shadow is checking target_feature support (simd flags).

baoyachi commented 2 years ago

Reference link:https://github.com/clap-rs/clap/issues/2840#issuecomment-1028298738

It may be similar to this issue. https://github.com/baoyachi/shadow-rs/issues/53

Do you have any good suggestions. @epage

epage commented 2 years ago

One idea I have is to create a non-exhaustive enum that either has an as_str or derefs to str that has the string version of the enum (which Display wraps). Then its just a matter of code-genning that similarly to the code in the clap issue.

I can take a crack at this tomorrow if you want.

baoyachi commented 2 years ago

Yeah,I look forward to your pr. @epage