Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
CMake
CMake
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,235
    • Issues 3,235
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 14
    • Merge Requests 14
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • External Wiki
    • External Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMake
  • CMakeCMake
  • Issues
  • #21393

Closed
Open
Opened Nov 03, 2020 by Rafael Spring@rafael.spring

CMake iOS Toolchain: Sample code in cmake-toolchains(7) does not work

This sample code

$ cmake -S. -B_builds -GXcode \
    -DCMAKE_SYSTEM_NAME=iOS \
    "-DCMAKE_OSX_ARCHITECTURES=armv7;armv7s;arm64;i386;x86_64" \
    -DCMAKE_OSX_DEPLOYMENT_TARGET=9.3 \
    -DCMAKE_INSTALL_PREFIX=`pwd`/_install \
    -DCMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO \
    -DCMAKE_IOS_INSTALL_COMBINED=YES

does not work if used in that form (tested on CMake 3.19.0 rc2, Xcode 12, MacOS 10.14.6). Specifically it will ignore variable settings and either fail at build stage or succeed but not build the desired product.

  1. Variable types need to be declared. -DCMAKE_SYSTEM_NAME=iOS needs to be -DCMAKE_SYSTEM_NAME:STRING=iOS. Similarly -DCMAKE_IOS_INSTALL_COMBINED=YES needs to be -DCMAKE_IOS_INSTALL_COMBINED:BOOL=YES. Same for all other variables in the sample code. If the variable types are not set, the configuration simply won't pick up the setting.

  2. Even if the variable types are declared correctly, if CMAKE_IOS_INSTALL_COMBINED is YES the build will fail with an error message "unable to attach DB: error: accessing build database ... : database is locked". To solve it I had to do this https://stackoverflow.com/a/52386834/1232524. Seems like this was described in #21282 (closed) already.

Edited Nov 03, 2020 by Brad King
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: cmake/cmake#21393