String compilerConfigsDir;
String moduleVersion;
+ String lastBuildConfigName;
+ String lastBuildCompilerName;
+
+ Map<String, NameCollisionInfo> lastBuildNamesInfo;
+
#ifndef MAKEFILE_GENERATOR
FileMonitor fileMonitor
{
delete filePath;
delete topNode;
delete name;
+ delete lastBuildConfigName;
+ delete lastBuildCompilerName;
+ if(lastBuildNamesInfo) { lastBuildNamesInfo.Free(); delete lastBuildNamesInfo; }
}
~Project()
topNode.info = CopyString(GetConfigName(config));
}
}
+
property char * filePath
{
set
}
}
+ ProjectConfig GetConfig(char * configName)
+ {
+ ProjectConfig result = null;
+ if(configName && configName[0] && configurations.count)
+ {
+ for(cfg : configurations; !strcmpi(cfg.name, configName))
+ {
+ result = cfg;
+ break;
+ }
+ }
+ return result;
+ }
+
+ ProjectNode FindNodeByObjectFileName(char * fileName, IntermediateFileType type, bool dotMain, ProjectConfig config)
+ {
+ ProjectNode result;
+ if(!lastBuildNamesInfo)
+ ProjectLoadLastBuildNamesInfo(this, config);
+ result = topNode.FindByObjectFileName(fileName, type, dotMain, lastBuildNamesInfo);
+ return result;
+ }
+
TargetTypes GetTargetType(ProjectConfig config)
{
TargetTypes targetType = localTargetType;
return false;
}
-
char * GetObjDirExpression(ProjectConfig config)
{
// TODO: Support platform options
int compilingEC = 0;
int numErrors = 0, numWarnings = 0;
bool loggedALine = false;
- char * configName = config ? config.name : "Common";
int lenMakeCommand = strlen(compiler.makeCommand);
int testLen = 0;
char * t;
char targetFileName[MAX_LOCATION];
targetFileName[0] = '\0';
CatTargetFileName(targetFileName, compiler, config);
- ide.outputView.buildBox.Logf("\n%s (%s) - ", targetFileName, configName);
+ ide.outputView.buildBox.Logf("\n%s (%s) - ", targetFileName, lastBuildConfigName);
}
if(numErrors)
ide.outputView.buildBox.Logf("%d %s, ", numErrors, (numErrors > 1) ? $"errors" : $"error");
bool singleProjectOnlyNode = onlyNodes && onlyNodes.count == 1 && onlyNodes[0].type == project;
int numJobs = compiler.numJobs;
char command[MAX_F_STRING*4];
- char * compilerName;
+ char * compilerName = CopyString(compiler.name);
+
+ delete lastBuildConfigName;
+ lastBuildConfigName = CopyString(config ? config.name : "Common");
+ delete lastBuildCompilerName;
+ lastBuildCompilerName = CopyString(compiler.name);
+ ProjectLoadLastBuildNamesInfo(this, config);
- compilerName = CopyString(compiler.name);
CamelCase(compilerName);
strcpy(configName, config ? config.name : "Common");
int len;
char pushD[MAX_LOCATION];
char cfDir[MAX_LOCATION];
- Map<String, NameCollisionInfo> namesInfo { };
GetIDECompilerConfigsDir(cfDir, true, true);
GetWorkingDir(pushD, sizeof(pushD));
ChangeWorkingDir(topNode.path);
ChangeWorkingDir(pushD);
- topNode.GenMakefileGetNameCollisionInfo(namesInfo, config);
for(node : onlyNodes)
{
if(node.GetIsExcluded(config))
else
{
if(!eC_Debug)
- node.DeleteIntermediateFiles(compiler, config, bitDepth, namesInfo, mode == cObject ? true : false);
- node.GetTargets(config, namesInfo, objDirExp.dir, makeTargets);
+ node.DeleteIntermediateFiles(compiler, config, bitDepth, lastBuildNamesInfo, mode == cObject ? true : false);
+ node.GetTargets(config, lastBuildNamesInfo, objDirExp.dir, makeTargets);
}
}
- namesInfo.Free();
- delete namesInfo;
}
}
}
}
+static inline void ProjectLoadLastBuildNamesInfo(Project prj, ProjectConfig cfg)
+{
+ if(prj.lastBuildNamesInfo)
+ {
+ prj.lastBuildNamesInfo.Free();
+ delete prj.lastBuildNamesInfo;
+ }
+ prj.lastBuildNamesInfo = { };
+ prj.topNode.GenMakefileGetNameCollisionInfo(prj.lastBuildNamesInfo, cfg);
+}
+
Project LegacyBinaryLoadProject(File f, char * filePath)
{
Project project = null;
{
if(!project.options) project.options = { };
if(activeConfigName && activeConfigName[0] && project.configurations)
- {
- for(cfg : project.configurations)
- {
- if(!strcmpi(cfg.name, activeConfigName))
- {
- project.config = cfg;
- break;
- }
- }
- }
+ project.config = project.GetConfig(activeConfigName);
if(!project.config && project.configurations)
project.config = project.configurations.firstIterator.data;