File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed
Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ add_library(SwiftDriver
2323 Driver/ModuleOutputInfo.swift
2424 Driver/OutputFileMap.swift
2525 Driver/ToolExecutionDelegate.swift
26+ Driver/DriverVersion.swift
2627
2728 Execution/ArgsResolver.swift
2829 Execution/DriverExecutor.swift
Original file line number Diff line number Diff line change @@ -830,6 +830,12 @@ extension Driver {
830830 buildRecordInfo == nil ) {
831831 assert ( jobs. count == 1 , " Cannot execute in place for multi-job build plans " )
832832 var job = jobs [ 0 ]
833+ // Print the driver source version first before we print the compiler
834+ // versions.
835+ if job. kind == . versionRequest && !Driver. driverSourceVersion. isEmpty {
836+ stderrStream <<< " swift-driver version: " <<< Driver . driverSourceVersion <<< " \n "
837+ stderrStream. flush ( )
838+ }
833839 // Require in-place execution for all single job plans.
834840 job. requiresInPlaceExecution = true
835841 try executor. execute ( job: job,
Original file line number Diff line number Diff line change 1+ //===------ DriverVersion.swift - Swift Driver Source Version--------------===//
2+ //
3+ // This source file is part of the Swift.org open source project
4+ //
5+ // Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
6+ // Licensed under Apache License v2.0 with Runtime Library Exception
7+ //
8+ // See https://swift.org/LICENSE.txt for license information
9+ // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+ //
11+ //===----------------------------------------------------------------------===//
12+ extension Driver {
13+ #if SWIFT_DRIVER_VERSION_DEFINED
14+ static let driverSourceVersion : String = SWIFT_DRIVER_VERSION
15+ #else
16+ static let driverSourceVersion : String = " "
17+ #endif
18+ }
You can’t perform that action at this time.
0 commit comments