Xcode: `"Based on dependency analysis" is unchecked` warning
I've noticed that cmake
returns warnings when Xcode
is selected as the generator.
Example:
CMakelists.txt
cmake_minimum_required(VERSION 3.20)
project(macos_app)
add_executable(macos_app main.cpp)
main.cpp
int main()
{
return 0;
}
Build command
rm -rf build && cmake -S . -B build/ -G Xcode -DCMAKE_CONFIGURATION_TYPES="Debug;Release" && cmake --build build/ --verbose
When the above command is run, the below warnings can be seen in the output.
note: Run script build phase 'Generate CMakeFiles/ZERO_CHECK' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'ZERO_CHECK' from project 'macos_app')
note: Run script build phase 'Generate CMakeFiles/ALL_BUILD' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'ALL_BUILD' from project 'macos_app')
When I further investigated the root cause of it, I found that cmake
sets the alwaysOutOfDate
flag in *.pbxproj
here and here.
It seems like cmake
uses Run script build phase
to check whether dependencies are modified or not.
Is there a way to disable those warnings? or remove them completely without changing the workflow of cmake
with Xcode
?
Xcode version: Version 14.3 (14E222b)
CMake version: cmake version 3.25.1
Edited by Orkun Tokdemir