gpt4 book ai didi

c++ - 在 premake 3.7 中,如何为 gcc 生成 -O0 而不是 -O2?

转载 作者:塔克拉玛干 更新时间:2023-11-03 08:00:19 26 4
gpt4 key购买 nike

似乎总是生成 -O2,除非我在 buildflags 中指定“optimize-speed”(生成 -O3)或“optimize-size”(生成 -Os)。如果我在 buildflags 中未指定任何内容,但将“-O0”传递给 buildoptions,则结果为“-O2 -O0”。然而,预期的结果只是“-O0”。

当我将“-O0”作为自定义构建选项传递时,如何防止生成“-O2”?该文档未提及任何相关内容。

最佳答案

可能有一种方法可以关闭 -02,但这不是必需的。

来自 GCC 手册页:

If you use multiple -O options, with or without level numbers, the last such option is the one that is effective.

关于c++ - 在 premake 3.7 中,如何为 gcc 生成 -O0 而不是 -O2?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8989042/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com