   ) throws -> Job? {
     guard moduleOutputInfo.output != nil,
           !(moduleInputs.isEmpty && moduleInputsFromJobOutputs.isEmpty),
-          compilerMode.usesPrimaryFileInputs
+          compilerMode.usesPrimaryFileInputs,
+          !shouldCreateEmitModuleJob
     else { return nil }
     return try mergeModuleJob(inputs: moduleInputs, inputsFromOutputs: moduleInputsFromJobOutputs)
   }

      }
    }

    if let compileJob = try addSingleCompileJobs(addJob: addJobBeforeCompiles,
                             addJobOutputs: addJobOutputs,
                             emitModuleTrace: loadedModuleTracePath != nil) {
      try addVerifyJobs(emitModuleJob: compileJob, addJob: addJobAfterCompiles)
    }

    try addJobsForPrimaryInputs(


    try addPrecompileModuleDependenciesJobs(addJob: addJobBeforeCompiles)
    try addPrecompileBridgingHeaderJob(addJob: addJobBeforeCompiles)
    let linkerInputs = try addJobsFeedingLinker(
      addJobBeforeCompiles: addJobBeforeCompiles,
      addCompileJobGroup: addCompileJobGroup,
