Open drewkett opened 2 weeks ago
I think this is a cmake
issue, they are modifying the Rust target triple and adding 11
to it, see https://github.com/rust-lang/cmake-rs/pull/39.
This is redundant nowadays, where:
cc
sets this value in the deployment target.And wrong because the target
value in cc
is the rustc
target, while cmake
invalidly assumed it refers to the Clang target.
With version 1.1.32, it now is not possible to build a project on MacOS using the cmake crate enabling c++11. I'm not sure whether to make this issue here or in cmake-rs but i'll make it here because its specifically a release of cc that broke it.
See this example
Cargo.toml
build.rs
"src"
is irrelevant here.This fails to build with
Looking at cmake code, it appends 11 as the target for C++11. My understanding is that
darwin11
here is the MacOS clang way of specifying the minimum target MacOS version. In thecmake
crate, theTARGET
env var is set with thataarch64-apple-darwin11
which then causescc
to fail when trying to parse the target to a target triple.After having typed this out, I'm guessing i can in all likelihood just stop setting
uses_cxx11
fromcmake
because any toolchains i'd be compiling with likely have C++11 available. I also wonder if insteadcmake
could use a different mechanism to ensure a minimum toolchain version, but I don't know enough about how that works to have an immediate answer there. However, I'll leave this ticket here to call out the issue (and in case others run into the same thing).