Add support for conditionally linking dependencies based on platform (#1087)

* Add initial support for conditional platform dependencies

* Add tests for conditional platforms

* Update docs and changelog

* Respond to PR feedback

* Change name of field from 'conditionalPlatforms' to 'platforms'

Co-authored-by: Yonas Kolb <yonaskolb@users.noreply.github.com>
This commit is contained in:
Dalton Claybrook
2021-06-20 06:19:02 -04:00
committed by GitHub
parent 4455919be3
commit 81bd52be4b
9 changed files with 80 additions and 27 deletions
+3 -3
View File
@@ -751,7 +751,7 @@ public class PBXProjGenerator {
for dependency in targetDependencies {
let embed = dependency.embed ?? target.shouldEmbedDependencies
let platform = makePlatform(for: dependency.platform)
let platform = makePlatformFilter(for: dependency.platformFilter)
switch dependency.type {
case .target:
@@ -1320,8 +1320,8 @@ public class PBXProjGenerator {
}
}
private func makePlatform(for platform: Dependency.Platform) -> String? {
switch platform {
private func makePlatformFilter(for filter: Dependency.PlatformFilter) -> String? {
switch filter {
case .all:
return nil
case .macOS: