Xcode, iOS: Incremental build regression
I've just updated from 3.24.4 to 3.26.3 CMake and noticed that incremental build almost doesn't work.
git bisect showed this commit as the first "bad" (related MR: !7730 (merged)).
I can confirm that resetting of TARGET_TEMP_DIR
build setting fixes the issue.
Our build configuration consist of two Xcode projects:
- CMake generated Xcode project. There are a few C++ dynamic iOS frameworks, let's name them Common and Engine. The Engine depends on Common.
- XcodeGen generated Xcode project with platform-specific SDK written in Swift language and several internal debug applications (Swift language). None of that uses CMake directly but all targets depend on Common, Engine, and PlatformSDK as precompiled dynamic frameworks.
Here is the graph presentation:
graph TD
subgraph CMake Xcode Project
A[Common] -->|dynamic| B[Engine]
end
subgraph XcodeGen Xcode Project
B -->|dynamic| C[PlatformSDK]
A -->|dynamic| C
C -->|dynamic| D[Debug Application]
A -->|dynamic| D
B -->|dynamic| D
end
The issue is 100% reproducible in that configuration by following steps:
- Configure the CMake project with Xcode generator
- Generate Xcode project with XcodeGen
- Make initial DebugApp build
- Swap any two lines of code in DebugApp-only Swift file
- Re-compile the Xcode project
Expected:
- Successful incremental build in about 2-3 seconds
Actual:
- Xcode rebuilds Common and Engine targets making incremental build to take 2 minutes.
Versions:
- CMake: 3.26.3 (starts from 3.25.0)
- Xcode: 14.2
- macOS: 13.3.1