I think it's very helpful to embedded development if it is possible to adjust the complier option for different file because some software module need special complie optimize level. "Use custom command to build this file" can achieve this taget but it's a littile trouble some when I want all the file in a specific folder.
I think the most simply way to achieve this would be load the build script and generate the complie command for each file. But now the complier framework seem generate the complie command for the whole target. So the build script can't help with this unless the complier framework change.
But I think this change would worth because it will enlarge the ability of the build script a lot and make the complier system much more flexible.
For example: I can check the base path or the name of the file in the script and add some complier option behind to override the taget option.