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 434 forks source link

Fix xcrun sdk version arg #1007

Closed 0123456789-jpg closed 5 months ago

0123456789-jpg commented 6 months ago

We should use xcrun --show-sdk-version ... to obtain targeted apple os version instead of --show-sdk-platform-version, as shown in my screenshot. 屏幕快照 2024-03-12 下午7 07 06

Closes #1001, closes #963

BlackHoleFox commented 6 months ago

Have a look at https://github.com/rust-lang/cc-rs/pull/1009 if you wouldn't mind as well. It ports some of clang's SDK reading logic into cc for this purpose. I'm worried about relying on --show-sdk-version always lining up with the deployment target and the other way also avoids needing xcrun to be present.

0123456789-jpg commented 5 months ago

@NobodyXu

NobodyXu commented 5 months ago

1009 sounds like a better solution, given that the json parser can be simplified in it.

NobodyXu commented 5 months ago

Merged this as a workaround, while waiting for #1009