Sfoglia il codice sorgente

Xcode: Relax swift compiler detection regex for Xcode 11

The Xcode 11 output:

```
  CompileSwift normal x86_64
  /Users/gregorj/Git/cmake/_build_xcode/Tests/SwiftOnly/CMakeFiles/3.15.20190826-g89479bd/CompilerIdSwift/CompilerId/main.swift
  (in target 'CompilerIdSwift' from project 'CompilerIdSwift')

      cd /Users/gregorj/Git/cmake/_build_xcode/Tests/SwiftOnly/CMakeFiles/3.15.20190826-g89479bd/CompilerIdSwift
      /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/gregorj/Git/cmake/_build_xcode/Tests/SwiftOnly/CMakeFiles/3.15.20190826-g89479bd/CompilerIdSwift/CompilerId/main.swift ...
```

The Xcode 10 output:

```
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
    cd /Users/gjasny/src/cmake/Tests/SwiftOnly
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -incremental -module-name SwiftOnly -O -enable-batch-mode -enforce-exclusivity=checked -swift-version 5.0 -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -target x86_64-apple-macosx10.14 -g -Xfrontend -serialize-debugging-options -swift-version 5 -Xlinker -rpath -Xlinker /usr/lib/swift -I /Users/gjasny/src/cmake/_build_xcode/Tests/SwiftOnly/Debug -F /Users/gjasny/src/cmake/_build_xcode/Tests/SwiftOnly/Debug -c -j24 /Users/gjasny/src/cmake/Tests/SwiftOnly/main.swift ...

CompileSwift normal x86_64 /Users/gjasny/src/cmake/Tests/SwiftOnly/main.swift
    cd /Users/gjasny/src/cmake/Tests/SwiftOnly
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/gjasny/src/cmake/Tests/SwiftOnly/main.swift ...

```

The Xcode 11 output lacks the CompileSwiftSources action but the
CompileSwift action is present for both and also look suitable.
Gregor Jasny 6 anni fa
parent
commit
5c028c27eb
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      Modules/CMakeDetermineSwiftCompiler.cmake

+ 1 - 1
Modules/CMakeDetermineSwiftCompiler.cmake

@@ -53,7 +53,7 @@ if(NOT CMAKE_Swift_COMPILER_ID_RUN)
     list(APPEND CMAKE_Swift_COMPILER_ID_MATCH_VENDORS Apple)
     set(CMAKE_Swift_COMPILER_ID_MATCH_VENDOR_REGEX_Apple "com.apple.xcode.tools.swift.compiler")
 
-    set(CMAKE_Swift_COMPILER_ID_TOOL_MATCH_REGEX "\nCompileSwiftSources[^\n]*(\n[ \t]+[^\n]*)*\n[ \t]+([^ \t\r\n]+)[^\r\n]* -c[^\r\n]*CompilerIdSwift/CompilerId/main.swift")
+    set(CMAKE_Swift_COMPILER_ID_TOOL_MATCH_REGEX "\nCompileSwift[^\n]*(\n[ \t]+[^\n]*)*\n[ \t]+([^ \t\r\n]+)[^\r\n]* -c[^\r\n]*CompilerIdSwift/CompilerId/main.swift")
     set(CMAKE_Swift_COMPILER_ID_TOOL_MATCH_INDEX 2)
   endif()