Dynamic OTHER_LDFLAGS in Xcode that are different between Mac (iPadOS designed app) and iOS app

huangapple go评论60阅读模式
英文:

Dynamic OTHER_LDFLAGS in Xcode that are different between Mac (iPadOS designed app) and iOS app

问题

我想为MacOS应用和iOS应用定义不同的OTHER_LDFLAGS。
我们有一个项目,从iOS构建到iPhone / iPad / MacOS(iPad设计的iOS)应用。
对于iPhone和iPad,我需要使用一组标志,但对于MacOS,需要不同的标志。

不幸的是,Xcode提供了一个仅适用于Catalyst的MacOS选择条件,但不适用于MacOS(iPad设计的iOS)应用。 >>

OTHER_LDFLAGS[sdk=macosx*]

-> 不支持iPad设计的MacOS应用。

有人知道我可以应用什么技巧来区分它们,并为每个平台传递特定的参数吗?

我想为每个平台iOS和Mac(iPad设计的iOS)设置不同的标志。

谢谢

英文:

I want to define different OTHER_LDFLAGS for the MacOS app and iOS app.
We have one project that builds from iOS to iPhone / iPad / MacOS (iPad-designed iOS) apps.
For iPhone and iPad I require to use one bunch of flags but for MacOS different.

Unfortunately, Xcode provides a MacOS selection condition that works only for Catalyst but does not work for MacOS (iPad-designed iOS) app. >>

OTHER_LDFLAGS[sdk=macosx*]

-> is not supporting iPad designed MacOS app.

Does anybody know what trick I can apply to differentiate them and pass a specific parameters for each platform?

I would like to have different flags per each platform iOS and Mac (iPad Designed iOS)

Thank you

答案1

得分: 0

终于,我来到了运行时检查的地方。考虑到我有来自库的处理程序,因此可以在那里执行操作,因为在配置层面无法理解平台,因为构建通常与平台相同,即iOS。最糟糕的是,我需要使用C++来处理这个处理程序,并在C++中桥接本机iOS以检索标志isIOSOnMac。

这对我的情况来说是可行的解决方案。

英文:

Finally, I came to the place which is running in runtime check.
Taking into consideration that I have a handler from the library the action was possible to be taken there as there is no way to understand the platform in the configuration layer as the build will be commonly the same as the platform is iOS.
The worst thing was I need to work with C++ which should be this handler and bridge native iOS in C++ to retrieve the flag isIOSOnMac.

That was a workable solution for my case

huangapple
  • 本文由 发表于 2023年2月24日 04:38:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/75550086.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定