Xcode13 Build System

升級問題

如果已經升級到Xcode13.0,可能會遇到如下問題

❌ The Legacy Build System will be removed in a future release. You can configure the selected build system and this deprecation message in File > Workspace Settings.

解決辦法

1、在Xcode->File->Project Settings/WorkSpace Settings->Build System,將其修改爲New Build System(Default)。因爲Leagcy Build System(Deprecated)正式棄用了

2、⚠️在警告中,按照project的Valide Project Settings點擊Update to recommended settings可以按照提示解決

Build System簡介

在Xcode9發佈的時候,Apple在Build System上提供了新版本的構建系統(New Build System),具體可見WWDC2017,蘋果講述了該構建系統的優點:降低構建開銷,尤其可以降低大型項目的構建開銷。

當然對於該新特性的使用,蘋果爲開發者提供了足夠的過度時間。在Xcode9中,該構建系統沒有設置爲默認的構建系統,而在Xcode10開始,蘋果將該系統設置爲默認的構建系統。

Xcode13 Build System 新特性

  • Configuration settings (.xcconfig) files now support using \ to break long lists across multiple lines. (4405473) (FB5943765)

    For example:

    HEADER_SEARCH_PATHS = $(SRCROOT)/include \    $(SRCROOT)/include/component1 \    $(SRCROOT)/include/component2
    
  • When you pass xcconfig files to xcodebuild using the -xcconfig command-line flag and XCODE_XCCONFIG_FILE environment variable, Xcode parses them using New Build System semantics, which also supports condition parameters. (25001734)

  • Configure frameworks to build for multiple platforms in a single build operation by setting the SUPPORTED_PLATFORMS build setting to the list of platforms you support and setting ALLOW_TARGET_PLATFORM_SPECIALIZATION to YES. (45951215)

  • You can now use platform filters in build phases and target dependencies for all supported platforms. (72240935)

  • xcodebuild now shows the target and project name for each failing command in the summary at the end of the build log when a build failure occurs. (75081458)

  • The build system now emits a warning when a script phase, or custom build rule, declares an input dependency that isn’t part of the build input and isn’t declared as an output dependency of any other task in the build. (76129954)

  • The build options sheet now includes a Dependency Order option, which replaces the Parallelize Build option, and a Manual Order option, which is deprecated, but included for legacy compatibility. (76251439)

參考文獻

  1. https://developer.apple.com/videos/play/wwdc2018/408/
  2. https://blog.csdn.net/TuGeLe/article/details/84885211
  3. https://developer.apple.com/documentation/xcode-release-notes/xcode-13-release-notes
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章