MSVC: Parallelize building of .asm files

This commit is contained in:
SupSuper 2020-11-15 21:30:26 +00:00
parent 3dd369e81f
commit 2af0fdd458
2 changed files with 7 additions and 5 deletions

View File

@ -483,15 +483,15 @@ bool hasEnding(std::string const &fullString, std::string const &ending) {
}
}
namespace {
inline void outputNasmCommand(std::ostream &projectFile, const std::string &config, const std::string &prefix) {
void MSBuildProvider::outputNasmCommand(std::ostream &projectFile, const std::string &config, const std::string &prefix) {
projectFile << "\t\t\t<Command Condition=\"'$(Configuration)|$(Platform)'=='" << config << "|Win32'\">nasm.exe -f win32 -g -o \"$(IntDir)" << prefix << "%(Filename).obj\" \"%(FullPath)\"</Command>\n"
<< "\t\t\t<Outputs Condition=\"'$(Configuration)|$(Platform)'=='" << config << "|Win32'\">$(IntDir)" << prefix << "%(Filename).obj;%(Outputs)</Outputs>\n";
if (_version >= 15) {
projectFile << "\t\t\t<OutputItemType Condition=\"'$(Configuration)|$(Platform)'=='" << config << "|Win32'\">Object</OutputItemType>\n"
<< "\t\t\t<BuildInParallel Condition=\"'$(Configuration)|$(Platform)'=='" << config << "|Win32'\">true</BuildInParallel>\n";
}
}
} // End of anonymous namespace
void MSBuildProvider::writeFileListToProject(const FileNode &dir, std::ofstream &projectFile, const int,
const std::string &objPrefix, const std::string &filePrefix) {
// Reset lists

View File

@ -74,6 +74,8 @@ private:
void outputFilter(std::ostream &filters, const FileEntries &files, const std::string &action);
void outputFiles(std::ostream &projectFile, const FileEntries &files, const std::string &action);
void outputNasmCommand(std::ostream &projectFile, const std::string &config, const std::string &prefix);
};
} // namespace CreateProjectTool