Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for specifying separate C and C++ compiler paths and args #9266

Open
Colengms opened this issue May 4, 2022 · 1 comment
Open

Comments

@Colengms
Copy link
Contributor

Colengms commented May 4, 2022

Feature Request

Currently, we have compilerPath and compilerArgs fields in c_cpp_properties.json. Arguments (i.e. -std=c++20 vs -std=c17), and perhaps even the compiler itself (i.e. XC16), can be C or C++ specific. These field may be insufficient for users who want to mix C and C++ sources. The same issue exists for fields in custom configuration provider interfaces.

This feature request tracks separating compilerPath and compilerArgs into C and C++, so separate values for each can be provided. One backwards compatible approach would be to allow the existing fields to be overloaded with an object containing a separate value per language. For example:

"compilerPath": {
    "c": "/usr/bin/gcc",
    "cpp": "/usr/bin/g++"
},
"compilerArgs": {
    "c": [ "-std=c17" ],
    "cpp": [ "-std=c++20" ]
}

Related: #7534

@Colengms
Copy link
Contributor Author

Colengms commented May 4, 2022

In some ways we are treating cuda-cpp as a separate language from C++, with it's own language ID. It might make sense for this feature to support cuda-cpp as well, and other language ID's that might be added in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant