The tool chain settings/flags that you set in the Project properties are applied to all the compilation units in the project. To define custom settings to a compilation unit, you need to set them as follows. When compilation is invoked these settings + the global settings are applied to the compilation unit. (Note : To workaround a bug, you need to click somewhere else on the UI after entering the flags in “Custom compilation setting”)
Also remember that the settings are applied only to the configuration selected in the standard tool bar. If you want to set the file level settings for a different configuration then change it from the standard tool bar and then enter the custom compilation settings and save. In this case all the custom settings applies only to the debug configuration.
Note : You can also select multiple files (using Ctrl+Left click) and enter the “Custom compilation setting”.