     /// - Returns: the commands to run during the build
     func createBuildCommands(context: PluginContext, target: Target) throws -> [Command] {
         let targetPackageDirectory = context.package.directory
-        let gir2swiftManifest = targetPackageDirectory.appending(gir2swiftManifestYaml)
+        let gir2swiftPackageDirectoryManifest = targetPackageDirectory.appending(gir2swiftManifestYaml)
+        let gir2swiftTargetDirectoryManifest = target.directory.appending(gir2swiftManifestYaml)
         let outputDir = context.pluginWorkDirectory.appending("gir2swift-generated").appending(target.name)
-        try FileManager.default.createDirectory(atPath: outputDir.string, withIntermediateDirectories: true)
+        let fileManager = FileManager.default
+        try fileManager.createDirectory(atPath: outputDir.string, withIntermediateDirectories: true)
 
         let girName = try getGirName(target)
 

            "-w", targetPackageDirectory.string,
            "-t", target.directory.string,
            "-o", outputDir.string,
            "--manifest", "\(gir2swiftManifest)",
        ]

        arguments.append(contentsOf: girFiles.flatMap { girFile in

            Path(file.path)
        }

        if fileManager.fileExists(atPath: gir2swiftTargetDirectoryManifest.string) {
            inputFiles.append(gir2swiftTargetDirectoryManifest)
        } else {
            inputFiles.append(gir2swiftPackageDirectoryManifest)
        }

        // Find all girs that this library depends on
        let girFiles = target.recursiveTargetDependencies.compactMap {
