Xcode: Cleaning does not remove intermediate build files
CMakeLists.txt
cmake_minimum_required(VERSION 3.25)
project(cmake_xcode_clean)
enable_language(Swift)
add_library(a empty.swift)
empty.swift can be an entirely empty file. (It being swift is not required, I just used the same sample code I already had for #24086 (closed))
- Create folder called build and run CMake 3.25rc2 and the Xcode generator in it.
- Open generated Xcode project and build the lib
- Clean in Xcode
- Files in build/CMakeFiles/a.dir/ have not been deleted
With CMake 3.24 it also does not work by default, you get warnings like Refusing to delete '…' because it contains one of the projects in this workspace:
. Unless one switches the project to use the Xcode default derived data location (away from the legacy one with which the project is generated). Then everything builds in DerivedData and is cleaned up properly.
I saw the changes here !7730 (merged) which now always set CONFIGURATION_BUILD_DIR. Previously it was possible to get CMake to generate an Xcode project that could build to DerivedData. That is now no longer possible, if I understand the code correctly. Was this intended and if yes is there a way to make this still an option?