rust-lang / cc-rs

Rust library for build scripts to compile C/C++ code into a Rust library
https://docs.rs/cc
Apache License 2.0
1.81k stars 437 forks source link

Chore: Refactor large-if/match: Extract array out of them #969

Open NobodyXu opened 6 months ago

NobodyXu commented 6 months ago

Currently there're a few huge if/match block for targets cc supports.

Having large if/match is hard to read, it also increases compilation time/binary size generated.

By extracting them out as an array, it would be simpler to read, edit, and faster to compile with smaller binary size.