mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Driver: extend -print-target-info with additional components
Render the platform and architecture directories that the target uses to allow computation of paths for installation.
This commit is contained in:
@@ -129,6 +129,9 @@ void targetinfo::printTripleInfo(
|
||||
writeEscaped(getTargetSpecificModuleTriple(triple).getTriple(), out);
|
||||
out << "\",\n";
|
||||
|
||||
out << " \"platform\": \"" << getPlatformNameForTriple(triple) << "\",\n";
|
||||
out << " \"arch\": \"" << swift::getMajorArchitectureName(triple) << "\",\n";
|
||||
|
||||
if (runtimeVersion) {
|
||||
out << " \"swiftRuntimeCompatibilityVersion\": \"";
|
||||
writeEscaped(runtimeVersion->getAsString(), out);
|
||||
|
||||
15
test/Driver/print-target-info-extended.swift
Normal file
15
test/Driver/print-target-info-extended.swift
Normal file
@@ -0,0 +1,15 @@
|
||||
// RUN: %swift_driver_plain -target aarch64-unknown-windows-msvc -print-target-info | %FileCheck -check-prefix CHECK-windows -check-prefix CHECK-aarch64 %s
|
||||
// RUN: %target-swift-frontend -print-target-info | %FileCheck -check-prefix CHECK-%target-sdk-name -check-prefix CHECK-%target-arch %s
|
||||
|
||||
// CHECK-android: "platform": "android",
|
||||
// CHECK-cygwin: "platform": "cgywin",
|
||||
// CHECK-embedded: "platform": "embedded",
|
||||
// CHECK-freebsd: "platform": "freebsd",
|
||||
// CHECK-linux: "platform": "linux",
|
||||
// CHECK-mingw: "platform": "mingw",
|
||||
// CHECK-openbsd: "platform": "openbsd",
|
||||
// CHECK-wasi: "platform": "wasi",
|
||||
// CHECK-windows: "platform": "windows",
|
||||
|
||||
// CHECK-aarch64: "arch": "aarch64"
|
||||
// CHECK-x86_64: "arch": "x86_64"
|
||||
Reference in New Issue
Block a user