Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upReplace `Option<&str>` with `Option<Enum>` in `cpp_link_stdlib` / `cpp_set_stdlib` #184
Comments
This was referenced Jul 13, 2017
This comment has been minimized.
This comment has been minimized.
|
It's true yeah that the set of libraries here is probably small, although I'd be wary of trying to use an exhaustive enum as this'll probably expand over time. I wonder if an enum directly may not buy much here? I'm not sure this is really a cross-toolchain option in the sense that there's a cross-platform intention you can specify and gcc-rs figures it out. Rather we may want to just have some doc examples of the possible values and whatnot here and document various strings rather than codify them in an enum. |
This comment has been minimized.
This comment has been minimized.
dtolnay
commented
Jul 31, 2017
|
Symbols and capitalization make it awkward to use anything but a &str. // enum
cpp_set_stdlib(gcc::Stdlib::StdCPlusPlus) // or StdCxx
// const
cpp_set_stdlib(gcc::STD_C_PLUS_PLUS) // STDCXX?
// raw identifier?? https://internals.rust-lang.org/t/pre-rfc-raw-identifiers/5502
cpp_set_stdlib(gcc::r#stdc++#)
// macro, able to catch typo at compile time but seems unnecessary
cpp_set_stdlib(stdlib!("stdc++"))
I agree. |
This comment has been minimized.
This comment has been minimized.
|
Ok, let's stick with |
alexcrichton
closed this
Jul 31, 2017
dtolnay
referenced this issue
Jul 31, 2017
Closed
Document the common values for cpp_link_stdlib / cpp_set_stdlib #223
This comment has been minimized.
This comment has been minimized.
dtolnay
commented
Jul 31, 2017
|
I filed #223 to follow up with documentation. |
brson commentedJul 13, 2017
I'm not sure this issue is correct actually.
In our review we were talking like this was an enum representing the C++ standard, but it is actually an option to control the name of the C++ standard library, e.g. "c++", "stdc++". Is this really a closed set that we can enumerate?
Needs further discussion before action. cc @alexcrichton @sfackler