Skip to content

Commit 8e2b9e9

Browse files
authored
Merge pull request #67439 from DougGregor/macro-platform-paths-simulator-to-device-5.9
2 parents bbba601 + ca44af6 commit 8e2b9e9

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

lib/Driver/DarwinToolChains.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,15 @@ void toolchains::Darwin::addPlatformSpecificPluginFrontendArgs(
660660
llvm::sys::path::remove_filename(platformPath); // specific SDK
661661
llvm::sys::path::remove_filename(platformPath); // SDKs
662662
llvm::sys::path::remove_filename(platformPath); // Developer
663+
664+
StringRef platformName = llvm::sys::path::filename(platformPath);
665+
if (platformName.endswith("Simulator.platform")){
666+
StringRef devicePlatformName =
667+
platformName.drop_back(strlen("Simulator.platform"));
668+
llvm::sys::path::remove_filename(platformPath); // Platform
669+
llvm::sys::path::append(platformPath, devicePlatformName + "OS.platform");
670+
}
671+
663672
llvm::sys::path::append(platformPath, "Developer");
664673
addExternalPluginFrontendArgs(platformPath, inputArgs, arguments);
665674
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// RUN: %target-swiftc_driver -driver-print-jobs -target x86_64-apple-ios15.0-simulator %s 2>&1 | %FileCheck %s
2+
// REQUIRES: OS=ios
3+
4+
// CHECK: -external-plugin-path
5+
// CHECK-SAME: .sdk/usr/lib/swift/host/plugins#
6+
// CHECK-SAME: .sdk/usr/bin/swift-plugin-server
7+
8+
// CHECK-SAME: -external-plugin-path
9+
// CHECK-SAME: .sdk/usr/local/lib/swift/host/plugins#
10+
// CHECK-SAME: .sdk/usr/bin/swift-plugin-server
11+
12+
// CHECK-SAME: -external-plugin-path
13+
// CHECK-SAME: iPhoneOS.platform/Developer/usr/lib/swift/host/plugins#
14+
// CHECK-SAME: iPhoneOS.platform/Developer/usr/bin/swift-plugin-server
15+
16+
// CHECK-SAME: -external-plugin-path
17+
// CHECK-SAME: iPhoneOS.platform/Developer/usr/local/lib/swift/host/plugins#
18+
// CHECK-SAME: iPhoneOS.platform/Developer/usr/bin/swift-plugin-server
19+
20+
// CHECK-SAME: -plugin-path
21+
// CHECK-SAME: {{(/|\\\\)}}lib{{(/|\\\\)}}swift{{(/|\\\\)}}host{{(/|\\\\)}}plugins
22+
23+
// CHECK-SAME: -plugin-path
24+
// CHECK-SAME: {{(/|\\\\)}}local{{(/|\\\\)}}lib{{(/|\\\\)}}swift{{(/|\\\\)}}host{{(/|\\\\)}}plugins

0 commit comments

Comments
 (0)