简体   繁体   English

我应该使用哪些优化/设置在 Xcode for MacOS 的发布模式下进行编译?

[英]What optimizations / settings should I use for compiling in release mode in Xcode for MacOS?

I have an app I am working on that will be used in MacOS with Adobe products.我正在开发一个应用程序,该应用程序将在 MacOS 中与 Adob​​e 产品一起使用。

The SDK only comes with a debug release mode for the projects. SDK 仅带有项目的调试发布模式。 If I try to edit the scheme and look under 'run', I cannot switch it to release as there is no other option either than debug.如果我尝试编辑方案并查看“运行”下的内容,则无法将其切换为发布,因为除了调试之外别无选择。 From what I've read, this means I either have to create a new scheme, or edit this one.从我读到的内容来看,这意味着我要么必须创建一个新方案,要么编辑这个方案。

In Windows, compiling between debug and release mode produces a huge performance difference in the app so I assume the same thing happens in MacOS.在 Windows 中,在调试模式和发布模式之间进行编译会在应用程序中产生巨大的性能差异,所以我假设在 MacOS 中也会发生同样的事情。 For this reason, it is important for me to set the appropriate optimizations correctly.因此,正确设置适当的优化对我来说很重要。 However, I have no idea which are important.但是,我不知道哪些是重要的。

Does anyone have suggestions on what are the key optimizations I should set by either editing the debug mode, or creating a new one, for optimal performance from my app?有没有人建议我应该通过编辑调试模式或创建新模式来设置哪些关键优化,以获得应用程序的最佳性能?

Thank you - I am a little blind in this department as I am a Windows developer and Mac is new to me.谢谢 - 我在这个部门有点盲目,因为我是一名 Windows 开发人员,而 Mac 对我来说是新手。

Thanks, -Richard谢谢,-理查德

To create a new scheme:要创建新方案:

  1. Get the screen looking like the following screenshot:使屏幕看起来像以下屏幕截图:

在此处输入图片说明

  1. Click on '+' under where it says AppStore.单击 AppStore 下方的“+”。 This creates a duplicate of an existing scheme with a new name.这将使用新名称创建现有方案的副本。

  2. Edit the newly created configuration with the desired compiler settings etc.使用所需的编译器设置等编辑新创建的配置。

The newly created configuration should then show up in the 'Edit Schemes' window.新创建的配置随后应显示在“编辑方案”窗口中。


Edit: To set optimisation flags, get your screen looking like this and then select the flags you want for each configuration:编辑:要设置优化标志,让你的屏幕看起来像这样,然后为每个配置选择你想要的标志:

设置优化标志

I encourage you to experiment.我鼓励你去尝试。 None of this is difficult.这一切都不难。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用GCC中的优化功能以发布模式进行构建? - How to build in release mode with optimizations in GCC? 我应该为 C++ 库使用哪些优化设置 - What optimization settings should I use for a C++ library 如何从启用了优化(发布模式)的二进制文件中分析崩溃转储? - How do I analyze a crash dump from a binary built with optimizations enabled (release mode)? 在发布模式下编译时出错 - Error while compiling in release mode 在发布模式下编译时出错,但在调试模式下编译时出错 - Error compiling in release mode but not in debug mode 我应该使用Minidumps进行哪些设置? - What settings should I be using with Minidumps? 如何配置 VS 代码以在发布模式下构建(clang + macOS) - how do I configure VS code to build in Release mode (clang + macOS) 为什么我的项目设置在发布模式下会发生冲突? - Why are my project settings conflicting in Release mode? 如何使用宏在发布模式下重新定义函数? - How do I use a macro to redefine a function in release mode? Android NDK 2020 C 代码 - 如何启用具有所有优化的发布模式 - Android NDK 2020 C code - How to enable release mode with all optimizations
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM