本帖最后由 IFX_Lingling 于 2023-12-4 11:56 编辑
1:对于一个工程的编译可以分为Debug 和 Release模式:
Debug模式和Release模式的主要区别在于Debug版本不优化代码同时生成调试信息,而Release版本优化代码并且不生成调试信息。Debug和Release并没有本质的区别,它们只是VS预定义提供的两组编译选项的集合,编译器只是按照预定的选项行动。
2:对于一种模式也有不同的优化等级,修改的步骤是:
打开Makefile文件,然后找到CONFIG参数,将这个参数赋值Custom:
- # Default build configuration. Options include:
- #
- # Debug -- build with minimal optimizations, focus on debugging.
- # Release -- build with full optimizations
- # Custom -- build with custom configuration, set the optimization flag in CFLAGS
- #
- # If CONFIG is manually edited, ensure to update or regenerate launch configurations
- # for your IDE.
- CONFIG=<font color="#ff0000">Custom</font>
这个时候就可以修改CFLAG的参数:- # Additional / custom C compiler flags.
- #
- # NOTE: Includes and defines should use the INCLUDES and DEFINES variable
- # above.
- CFLAGS=<font color="#ff0000">-Os</font>
优化等级可以根据自己的需求去设置。
|