Improve compilation time of asset_processor

By splitting it up into object files and letting them be compiled in
parallel. Also only rebuild the parts that changed.
This commit is contained in:
octorock
2021-11-19 20:58:25 +01:00
parent 24e1a6091c
commit 91ad7860b2
10 changed files with 115 additions and 33 deletions
+6 -3
View File
@@ -1,5 +1,6 @@
#include "gfx.h"
#include "util.h"
#include <json.hpp>
std::filesystem::path GfxAsset::generateAssetPath() {
std::filesystem::path pngPath = this->path;
@@ -18,9 +19,11 @@ void GfxAsset::convertToHumanReadable(const std::vector<char>& baserom) {
cmd.push_back(toolsPath / "gbagfx" / "gbagfx");
cmd.push_back(this->path);
cmd.push_back(this->assetPath);
for (const auto& it : this->asset["options"].items()) {
cmd.push_back("-" + it.key());
cmd.push_back(to_string(it.value()));
if (this->asset.contains("options")) {
for (const auto& it : this->asset["options"].items()) {
cmd.push_back("-" + it.key());
cmd.push_back(to_string(it.value()));
}
}
check_call(cmd);
}