How to add compiler flags in VSCode

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to add compiler flags in VSCode

347 Views
tisch
Contributor I

Hi,

how can I add compiler flags to VSCode?

I started a example from the NXP SDK with the MCUXpressor for VSCode plugin, which works good, but I need to change some compiler settings.

For example I don't need warnings into errors or need to change the optimization for compilation.

How can I change these settings?

 

Thank you.

0 Kudos
Reply
1 Reply

319 Views
carlos_o
NXP TechSupport
NXP TechSupport

Hi @tisch,

Thank you for your post

The compiler Flags at MCUXpresso extension for VSCode could be edited in the CMakeLists.txt file that is located in your Project Files

You could refer to Assembler/Compiler/Linker Flags

For examples if you are using armgcc you need to use 

mcux_add_armgcc_configuration(

CC "-O0"

)

Let me know if this information helps

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2347172%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHow%20to%20add%20compiler%20flags%20in%20VSCode%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2347172%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3Ehow%20can%20I%20add%20compiler%20flags%20to%20VSCode%3F%3C%2FP%3E%3CP%3EI%20started%20a%20example%20from%20the%20NXP%20SDK%20with%20the%20MCUXpressor%20for%20VSCode%20plugin%2C%20which%20works%20good%2C%20but%20I%20need%20to%20change%20some%20compiler%20settings.%3C%2FP%3E%3CP%3EFor%20example%20I%20don't%20need%20warnings%20into%20errors%20or%20need%20to%20change%20the%20optimization%20for%20compilation.%3C%2FP%3E%3CP%3EHow%20can%20I%20change%20these%20settings%3F%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThank%20you.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2347431%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20How%20to%20add%20compiler%20flags%20in%20VSCode%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2347431%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F261224%22%20target%3D%22_blank%22%3E%40tisch%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EThank%20you%20for%20your%20post%3C%2FP%3E%0A%3CP%3EThe%20compiler%20Flags%20at%20MCUXpresso%20extension%20for%20VSCode%20could%20be%20edited%20in%20the%20CMakeLists.txt%20file%20that%20is%20located%20in%20your%20Project%20Files%3C%2FP%3E%0A%3CP%3EYou%20could%20refer%20to%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fmcuxpresso.nxp.com%2Fmcuxsdk%2Flatest%2Fhtml%2Fdevelop%2Fbuild_system%2FIDE_Project.html%3F_gl%3D1*1bja8dc*_ga*NDYxMDQ4ODkwLjE3NzU2Njg5Njg.*_ga_WM5LE0KMSH*czE3NzU2Njg5NjgkbzEkZzEkdDE3NzU2NjkwMjQkajQkbDAkaDEwNDQ5NTUy%23assembler-compiler-linker-flags%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EAssembler%2FCompiler%2FLinker%20Flags%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EFor%20examples%20if%20you%20are%20using%20armgcc%20you%20need%20to%20use%26nbsp%3B%3C%2FP%3E%0A%3CP%3Emcux_add_armgcc_configuration(%3C%2FP%3E%0A%3CP%3ECC%20%22-O0%22%3C%2FP%3E%0A%3CP%3E)%3C%2FP%3E%0A%3CP%3ELet%20me%20know%20if%20this%20information%20helps%3C%2FP%3E%3C%2FLINGO-BODY%3E