From 9899750953f40eb156f96844b80f1cc2a57c08b6 Mon Sep 17 00:00:00 2001 From: giginet Date: Wed, 5 Jun 2024 15:13:24 +0900 Subject: [PATCH] Revert "Merge pull request #124 from giginet/link-dependencies-of-targets" This reverts commit d02941363f459a7d5d09e1629b81cb5220601bb5, reversing changes made to 4e0c4b7f608d2bb7c67d25a7b4e28b64690b1959. --- .../ScipioKit/Producer/PIF/PIFGenerator.swift | 33 ------------------- 1 file changed, 33 deletions(-) diff --git a/Sources/ScipioKit/Producer/PIF/PIFGenerator.swift b/Sources/ScipioKit/Producer/PIF/PIFGenerator.swift index 56674d6d..fcc79fbd 100644 --- a/Sources/ScipioKit/Producer/PIF/PIFGenerator.swift +++ b/Sources/ScipioKit/Producer/PIF/PIFGenerator.swift @@ -276,42 +276,9 @@ private struct PIFLibraryTargetModifier { configuration.buildSettings = settings - linkAllDependencies(of: pifTarget) - return configuration } - /// Link all dependencies of the target - /// The original implementations of PIFBuilder links all dependencies to the PackageProduct targets - /// However, Scipio ignores PackageProduct so targets' dependencies haven't be linked - private func linkAllDependencies(of pifTarget: PIF.Target) { - let buildFiles = pifTarget.dependencies.enumerated().map { (index, dependency) in - PIF.BuildFile(guid: guid("FRAMEWORKS_BUILD_FILE_\(index)"), - targetGUID: dependency.targetGUID, - platformFilters: dependency.platformFilters) - } - - if let buildPhase = fetchBuildPhase(of: PIF.FrameworksBuildPhase.self, in: pifTarget) { - buildPhase.buildFiles.append(contentsOf: buildFiles) - } else { - let buildPhase = PIF.FrameworksBuildPhase( - guid: guid("FRAMEWORKS_BUILD_PHASE"), - buildFiles: buildFiles - ) - pifTarget.buildPhases.append(buildPhase) - } - } - - /// Fetch BuildPhase of the passed type - private func fetchBuildPhase(of buildPhasesType: BuildPhase.Type, in pifTarget: PIF.Target) -> BuildPhase? { - pifTarget.buildPhases.compactMap({ $0 as? BuildPhase }).first - } - - /// Build GUID with suffixes - private func guid(_ suffixes: String...) -> String { - "GUID::SCIPIO::\(pifTarget.name)::" + suffixes.joined(separator: "::") - } - // Append extraFlags from BuildOptionsMatrix to each target settings private func appendExtraFlagsByBuildOptionsMatrix(to settings: inout PIF.BuildSettings) { func createOrUpdateFlags(for key: PIF.BuildSettings.MultipleValueSetting, to keyPath: KeyPath) {