mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Instead of the code querying the compiler's built-in Clang instance, refactor the dependency scanner to explicitly keep track of module output path. It is still set according to '-module-cache-path' as it has been prior to this change, but now the scanner can use a different module cache for scanning PCMs, as specified with '-clang-scanner-module-cache-path', without affecting module output path. Resolves rdar://113222853
16 lines
811 B
Swift
16 lines
811 B
Swift
// RUN: %empty-directory(%t.module-cache)
|
|
// RUN: %empty-directory(%t.scanner-cache)
|
|
|
|
// RUN: %target-swift-frontend -scan-dependencies -module-cache-path %t.module-cache -clang-scanner-module-cache-path %t.scanner-cache %s -o %t.deps.json -I %S/Inputs/SwiftDifferent -dump-clang-diagnostics 2>&1 | %FileCheck %s --check-prefix=CHECK-CLANG-COMMAND
|
|
// RUN: %validate-json %t.deps.json | %FileCheck %s --check-prefix=CHECK-DEPS
|
|
|
|
// Ensure we prefer clang scanner module cache path
|
|
// CHECK-CLANG-COMMAND: '-fmodules-cache-path={{.*}}.scanner-cache'
|
|
|
|
// Ensure we the modules' output path is set to the module cache
|
|
// CHECK-DEPS: "swift": "A"
|
|
// CHECK-DEPS: "swift": "A"
|
|
// CHECK-DEPS: "modulePath": "{{.*}}separate_clang_scan_cache.swift.tmp.module-cache{{/|\\\\}}A-{{.*}}.swiftmodule"
|
|
|
|
import A
|