cc-rs icon indicating copy to clipboard operation
cc-rs copied to clipboard

Explicit method to specify C/C++ standard

Open alexeyr opened this issue 5 years ago • 0 comments

It would be nice to specify the standard explicitly as a method on Build, e.g. Build::new().standard("c++14"). This abstracts from difference between GCC/Clang -std= and MSVC /std:. Questions to answer:

  1. What to do if you pass gnu14 on MSVC: translate to the closest c++14 or give an error?
  2. Similarly, MSVC doesn't yet support /std:c++20 and requires /std:c++latest for C++20 features. Should standard("c++20") test if /std:c++20 works and use /std:c++latest if it isn't?

alexeyr avatar Nov 18 '20 13:11 alexeyr