Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,818
    • Issues 3,818
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 8
    • Merge requests 8
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMake
  • CMakeCMake
  • Issues
  • #22550
Closed
Open
Created Aug 18, 2021 by Daniel Evans@danhedron

XCode new build system: Clean always fails with subdirectory

This is an issue when using the new build system in XCode 12 and 13. Any non-trivial project fails to clean after building, as the new build system will refuse to delete a folder in the build tree.

Tested in CMake 3.19 and CMake 3.21.1

$ cmake --build . --target clean
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project clean_test.xcodeproj clean -target ALL_BUILD -parallelizeTargets -configuration Debug -hideShellScriptEnvironment

User defaults from command line:
    HideShellScriptEnvironment = YES

note: Using new build system
note: Building targets in parallel
warning: Refusing to delete `/tmp/Code/cmake/clean_test/build` because it contains one of the projects in this workspace: `/tmp/Code/cmake/clean_test/build/clean_test.xcodeproj`.
error: Could not delete `/tmp/Code/cmake/clean_test/build/test_app` because it was not created by the build system.
warning: Refusing to delete `/tmp/Code/cmake/clean_test/build` because it contains one of the projects in this workspace: `/tmp/Code/cmake/clean_test/build/clean_test.xcodeproj`.

** CLEAN FAILED **

Project that reproduces the issue: clean_test.zip

Edited Aug 19, 2021 by Brad King
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking