franneck94 / Vscode-C-Cpp-Runner

🚀 Compile, run and debug single or multiple C/C++ files with ease. 🚀
MIT License
53 stars 14 forks source link

It would be nice to be able to modify the command line for the compiler #66

Closed Reneg973 closed 2 years ago

Reneg973 commented 2 years ago

E.g. Seems like it is not possible to modify -O3. Would be nice feature!

franneck94 commented 2 years ago

Hi, you could just enter the optimization flag in the "compilerArgs" field, the standard one should be overwritten. https://godbolt.org/z/obeqbrdYv

Reneg973 commented 2 years ago

I tried the compilerArgs already, what happened in command line was the following: clang++ ... -O3 ... -O1 It compiled without errors but I think the second parameter was simply ignored

franneck94 commented 2 years ago

At least in the Compiler Explorer link, the first argument is overridden.

Reneg973 commented 2 years ago

Ok thanks, seems to work. Now the only issue is that the same command line parameters are applied to debug and release.