mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
GYP/Ninja Windows build: complete, build scripts updated.
Telegram.sln deleted, in the future .sln will be in .gitignore.
This commit is contained in:
@@ -47,6 +47,14 @@ Options parseOptions() {
|
||||
if (arg == "--rebuild") {
|
||||
result.rebuildDependencies = true;
|
||||
|
||||
// Skip generating style modules
|
||||
} else if (arg == "--skip-styles") {
|
||||
result.skipStyles = true;
|
||||
|
||||
// Skip generating sprite_125x.png and sprite_150x.png
|
||||
} else if (arg == "--skip-sprites") {
|
||||
result.skipSprites = true;
|
||||
|
||||
// Include paths
|
||||
} else if (arg == "-I") {
|
||||
if (++i == count) {
|
||||
|
@@ -31,6 +31,8 @@ struct Options {
|
||||
QString outputPath = ".";
|
||||
QString inputPath;
|
||||
bool rebuildDependencies = false;
|
||||
bool skipStyles = false;
|
||||
bool skipSprites = false;
|
||||
};
|
||||
|
||||
// Parsing failed if inputPath is empty in the result.
|
||||
|
@@ -65,36 +65,40 @@ int Processor::launch() {
|
||||
}
|
||||
|
||||
bool Processor::write(const structure::Module &module) const {
|
||||
QDir dir(options_.outputPath);
|
||||
if (!dir.mkpath(".")) {
|
||||
common::logError(kErrorCantWritePath, "Command Line") << "can not open path for writing: " << dir.absolutePath().toStdString();
|
||||
return false;
|
||||
bool forceReGenerate = false;
|
||||
bool onlyStyles = options_.skipSprites;
|
||||
bool onlySprites = options_.skipStyles;
|
||||
if (!onlyStyles) {
|
||||
SpriteGenerator spriteGenerator(module, forceReGenerate);
|
||||
if (!spriteGenerator.writeSprites()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!onlySprites) {
|
||||
QDir dir(options_.outputPath);
|
||||
if (!dir.mkpath(".")) {
|
||||
common::logError(kErrorCantWritePath, "Command Line") << "can not open path for writing: " << dir.absolutePath().toStdString();
|
||||
return false;
|
||||
}
|
||||
|
||||
QFileInfo srcFile(module.filepath());
|
||||
QString dstFilePath = dir.absolutePath() + '/' + destFileBaseName(module);
|
||||
QFileInfo srcFile(module.filepath());
|
||||
QString dstFilePath = dir.absolutePath() + '/' + destFileBaseName(module);
|
||||
|
||||
bool forceReGenerate = false;// !options_.rebuildDependencies;
|
||||
common::ProjectInfo project = {
|
||||
"codegen_style",
|
||||
srcFile.fileName(),
|
||||
"stdafx.h",
|
||||
forceReGenerate
|
||||
};
|
||||
common::ProjectInfo project = {
|
||||
"codegen_style",
|
||||
srcFile.fileName(),
|
||||
"stdafx.h",
|
||||
forceReGenerate
|
||||
};
|
||||
|
||||
SpriteGenerator spriteGenerator(module, forceReGenerate);
|
||||
if (!spriteGenerator.writeSprites()) {
|
||||
return false;
|
||||
Generator generator(module, dstFilePath, project);
|
||||
if (!generator.writeHeader()) {
|
||||
return false;
|
||||
}
|
||||
if (!generator.writeSource()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Generator generator(module, dstFilePath, project);
|
||||
if (!generator.writeHeader()) {
|
||||
return false;
|
||||
}
|
||||
if (!generator.writeSource()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user