Skip to content

Commit cebebe3

Browse files
committed
Respect impl only import flag
1 parent 66545f8 commit cebebe3

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Sources/Build/LLBuildCommands.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,13 @@ import SPMBuildCore
1717
import SPMLLBuild
1818
import PackageModel
1919

20-
import struct SwiftDriver.BuildRecordArguments
21-
import struct SwiftOptions.OptionTable
20+
#if USE_IMPL_ONLY_IMPORTS
21+
@_implementationOnly import SwiftDriver
22+
@_implementationOnly import SwiftOptions
23+
#else
24+
import SwiftDriver
25+
import SwiftOptions
26+
#endif
2227

2328
import class TSCBasic.LocalFileOutputByteStream
2429

@@ -442,6 +447,8 @@ final class PackageStructureCommand: CustomLLBuildCommand {
442447
let parsedOptions = try optionTable.parse(Array(buildParameters.flags.swiftCompilerFlags), for: .batch)
443448
let buildRecordInfoHash = BuildRecordArguments.computeHash(parsedOptions)
444449

450+
// Replace the swiftCompilerFlags with a hash of themselves where arguments that
451+
// do not affect incremental builds are removed.
445452
buildParameters.flags.swiftCompilerFlags = [buildRecordInfoHash]
446453

447454
return buildParameters

0 commit comments

Comments
 (0)