Skip to content
GitLab
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 4,103
    • Issues 4,103
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 18
    • Merge requests 18
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and 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
  • CMakeCMake
  • CMakeCMake
  • Issues
  • #16326
Closed
Open
Issue created Sep 25, 2016 by Gregor Jasny@gjasnyDeveloper

With Xcode 8 CMake cannot detect Swift compiler

I get the following error:

Compiling the Swift compiler identification source file "CompilerId/main.swift" failed.
Compiler:  
Build flags: 
Id flags: 

The output was:
65
=== BUILD TARGET CompilerIdSwift OF PROJECT CompilerIdSwift WITH THE DEFAULT CONFIGURATION (Debug) ===

Check dependencies
“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.

** BUILD FAILED **

The trick is to specify the required Swift version in the Xcode project:

                        isa = XCBuildConfiguration;
                        buildSettings = {
                                PRODUCT_NAME = CompilerIdSwift;
+                               SWIFT_VERSION = 2.3;
                        };
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking