我试着在网上寻找不同之处,但一无所获。这两个选项听起来相互关联:
/LTCG:https://msdn.microsoft.com/en-us/library/xbf3tbeh.aspx
The /LTCG option tells the linker to call the compiler and perform whole-program optimization.
/总帐:https://msdn.microsoft.com/en-us/library/0zza0de8.aspx
Enables whole program optimization.
有人知道确切的区别吗?
最佳答案
/GL
是编译器选项,/LTCG
是链接器选项。根据文档,它们彼此密切相关。例如:
/LTCG
is implied with/GL
但是,/LTCG
可以在不使用 /GL
的情况下使用。
The
/LTCG
option tells the linker to call the compiler and perform whole-program optimization. You can also do profile guided optimization.
如何启用配置文件引导优化?通过使用 /GL
选项。
/GL
also makes profile guided optimization available; see/LTCG
什么是配置文件引导优化?这是 profile guided optimization documentation 开头的片段:
Profile-guided optimization lets you optimize an output file, where the optimizer uses data from test runs of the .exe or .dll file. The data represents how the program is likely to perform in a production environment.
关于c++ - Visual Studio中/GL和/LTCG有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35471658/