         case .release: break
         }
 
-        args += buildParameters.indexStoreArguments
+        args += buildParameters.indexStoreArguments(for: target)
         args += buildParameters.toolchain.extraSwiftCFlags
         args += optimizationArguments
         args += ["-g"]

        case .off:
            addIndexStoreArguments = false
        case .auto:
            addIndexStoreArguments = configuration == .debug
        }

        if addIndexStoreArguments {

    }

    /// Returns the compiler arguments for the index store, if enabled.
    fileprivate func indexStoreArguments(for target: ResolvedTarget) -> [String] {
        let addIndexStoreArguments: Bool
        switch indexStoreMode {
        case .on:
