          ? Optional.of(
                getProjectFilesystem()
                    .getRootPath()
                    .resolve(
                        BuildTargetPaths.getScratchPath(
                            getProjectFilesystem(), getBuildTarget(), "%s__filelist.txt")))
            : Optional.empty();

    this.shouldEmitSwiftdocs = swiftBuckConfig.getEmitSwiftdocs();
    this.useModulewrap = swiftBuckConfig.getUseModulewrap();
    this.compileForceCache = swiftBuckConfig.getCompileForceCache();
    this.swiftdocPath = outputPath.resolve(escapedModuleName + ".swiftdoc");

    this.srcs = ImmutableSortedSet.copyOf(srcs);
    this.swiftTarget = swiftTarget;
    this.version = version;
    this.compilerFlags =
        new ImmutableList.Builder<Arg>()
            .addAll(StringArg.from(swiftBuckConfig.getCompilerFlags().orElse(ImmutableSet.of())))
            .addAll(compilerFlags)
            .build();
    this.enableObjcInterop = enableObjcInterop.orElse(true);
    this.bridgingHeader = bridgingHeader;
    this.cPreprocessor = preprocessor;
    this.cxxDeps = cxxDeps;
    this.depsSupplier = BuildableSupport.buildDepsSupplier(this, graphBuilder);
    performChecks(buildTarget);
  }

  private void performChecks(BuildTarget buildTarget) {
    Preconditions.checkArgument(
        !LinkerMapMode.FLAVOR_DOMAIN.containsAnyOf(buildTarget.getFlavors().getSet()),
        "SwiftCompile %s should not be created with LinkerMapMode flavor (%s)",
        this,
        LinkerMapMode.FLAVOR_DOMAIN);
    Preconditions.checkArgument(
        !buildTarget.getFlavors().contains(CxxDescriptionEnhancer.SHARED_FLAVOR));
  }

  private SwiftCompileStep makeCompileStep(SourcePathResolverAdapter resolver) {
    ImmutableList.Builder<String> compilerCommand = ImmutableList.builder();
    compilerCommand.addAll(swiftCompiler.getCommandPrefix(resolver));

    compilerCommand.add("-target", swiftTarget.getTriple());

    if (bridgingHeader.isPresent()) {
      compilerCommand.add(
          "-import-objc-header", resolver.getRelativePat