thomasjo / atom-ide-cpp

C/C++ language support for Atom-IDE
33 stars 4 forks source link

How to add flags to the clang? #23

Open DKarampistis opened 3 years ago

DKarampistis commented 3 years ago

I am trying to add the -std=c++17 flag to the clang command. Adding the option in the main.js like this: const args = ["-std=c++17"] Make the the plugin not to work. Diagnoses show no errors any more no matter what the error is even when the syntax is wrong. Pressing ctrl will no longer allow me to find the reference of the highlighted word. Atom's developer console show no errors. Running the command clang -std=c++17 *.cpp in the project folder works like a charm.

OS: Fedora 33 Atom: 1.53.0 Electron: 6.1.12 Chrome: 76.0.3809.146 Node: 12.4.0 Clang: 11.0.0

ell1e commented 3 years ago

You probably want to try a compile_flags.txt file: https://clang.llvm.org/docs/JSONCompilationDatabase.html#alternatives (not specific to this Atom plugin)