Xcode: CMake fails only first time with a syntax error but other tries succeed
I've noticed that there is a problem in cmake
cache or timestamps when I select Xcode
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, it works successfully. If I add a syntax error like the one below and run the below command it will fail.
cmake_minimum_required(VERSION 3.20)
project(macos_app)
add_executable(macos_app main.cpp)
asdasd
command
cmake --build build
But if I rerun the above command, it will succeed and ignore the syntax error.
Could you please check it?
Thank you in advance.
Xcode version: Version 14.3 (14E222b)
CMake version: cmake version 3.25.1
Edited by Orkun Tokdemir