return config ? config.name : "Common";
}
-public enum SingleFileCompileMode { normal, debugPrecompile, debugCompile, debugGenerateSymbols, cObject };
+public enum SingleFileCompileMode
+{
+ normal, debugPrecompile, debugCompile, debugGenerateSymbols, cObject;
+
+ property bool eC_ToolsDebug { get { return this == debugCompile || this == debugGenerateSymbols || this == debugPrecompile; } }
+};
class Project : struct
{
}
}
- void ProcessPipeOutputRaw(DualPipe f)
+ bool ProcessPipeOutputRaw(DualPipe f)
{
char line[65536];
- while(!f.Eof() && !ide.ShouldStopBuild())
+ while(!f.Eof() && !ide.projectView.stopBuild)
{
bool result = true;
double lastTime = GetTime();
}
//if(!result) Sleep(1.0 / PEEK_RESOLUTION);
}
- if(ide.ShouldStopBuild())
+ if(ide.projectView.stopBuild)
{
ide.outputView.buildBox.Logf($"\nBuild cancelled by user.\n", line);
f.Terminate();
}
+ return !ide.projectView.stopBuild;
}
bool ProcessBuildPipeOutput(DualPipe f, DirExpression objDirExp, bool isARun, List<ProjectNode> onlyNodes,
testLen = Max(testLen, windres.size);
testLen++;
- while(!f.Eof() && !ide.ShouldStopBuild())
+ while(!f.Eof() && !ide.projectView.stopBuild)
{
bool result = true;
double lastTime = GetTime();
}
//if(!result) Sleep(1.0 / PEEK_RESOLUTION);
}
- if(ide.ShouldStopBuild())
+ if(ide.projectView.stopBuild)
{
ide.outputView.buildBox.Logf($"\nBuild cancelled by user.\n", line);
f.Terminate();
delete strip;
delete ar;
- return numErrors == 0;
+ return numErrors == 0 && !ide.projectView.stopBuild;
}
void ProcessCleanPipeOutput(DualPipe f, CompilerConfig compiler, ProjectConfig config)
bool crossCompiling = (compiler.targetPlatform != GetRuntimePlatform());
char * targetPlatform = crossCompiling ? (char *)compiler.targetPlatform : "";
+ bool eC_Debug = mode.eC_ToolsDebug;
+ bool singleProjectOnlyNode = onlyNodes && onlyNodes.count == 1 && onlyNodes[0].type == project;
int numJobs = compiler.numJobs;
char command[MAX_F_STRING*4];
char * compilerName;
ide.outputView.buildBox.Logf($"File %s is excluded from current build configuration.\n", node.name);
else
{
- if(mode == cObject || mode == normal)
+ if(!eC_Debug)
node.DeleteIntermediateFiles(compiler, config, bitDepth, namesInfo, mode == cObject ? true : false);
node.GetTargets(config, namesInfo, objDirExp.dir, makeTargets);
}
bitDepth ? " ARCH=" : "",
bitDepth == 32 ? "32" : bitDepth == 64 ? "64" : "",
/*(bitDepth == 64 && compiler.targetPlatform == win32) ? " GCC_PREFIX=x86_64-w64-mingw32-" : (bitDepth == 32 && compiler.targetPlatform == win32) ? " GCC_PREFIX=i686-w64-mingw32-" :*/ "",
- compilerName, (mode == debugCompile || mode == debugGenerateSymbols || mode == debugPrecompile) ? "--always-make " : "", numJobs,
- compiler.ccacheEnabled ? "CCACHE=y " : "",
- compiler.distccEnabled ? "DISTCC=y " : "",
- (String)makeTargets, topNode.path, (justPrint || (mode != normal && mode != cObject)) ? " -n" : "", makeFilePath);
+ compilerName, eC_Debug ? "--always-make " : "", numJobs,
+ (compiler.ccacheEnabled && !eC_Debug) ? "CCACHE=y " : "",
+ (compiler.distccEnabled && !eC_Debug) ? "DISTCC=y " : "",
+ (String)makeTargets, topNode.path, (justPrint || eC_Debug) ? " -n" : "", makeFilePath);
if(justPrint)
ide.outputView.buildBox.Logf("%s\n", command);
{
bool found = false;
bool error = false;
- if(mode != normal && mode != cObject)
+ if(eC_Debug)
{
char line[65536];
+ if(justPrint)
+ ide.outputView.buildBox.Logf($"\nMake outputs the following list of commands to choose from:\n");
while(!f.Eof())
{
bool result = true;
{
if((result = f.Peek()) && (result = f.GetLine(line, sizeof(line)-1)))
{
+ if(justPrint)
+ ide.outputView.buildBox.Logf("%s\n", line);
if(!error && !found && strstr(line, "echo ") == line)
{
strcpy(command, line+5);
error = true;
}
- if(!error && !found && strstr(line, "ide ") == line)
+ if(!error && (singleProjectOnlyNode || !found) && strstr(line, "ide ") == line)
{
strcpy(command, line);
found = true;
result = true;
}
else if(justPrint)
- {
- ProcessPipeOutputRaw(f);
- result = true;
- }
+ result = ProcessPipeOutputRaw(f);
else
result = ProcessBuildPipeOutput(f, objDirExp, isARun, onlyNodes, compiler, config, bitDepth);
delete f;
- if(error || (justPrint && found))
+ if(error)
ide.outputView.buildBox.Logf("%s\n", command);
+ else if(justPrint && found)
+ ide.outputView.buildBox.Logf($"\nThe following command was chosen to be executed:\n%s\n", command);
else if(found)
Execute(command);
}
delete target;
}
- void Compile(List<ProjectNode> nodes, CompilerConfig compiler, ProjectConfig config, int bitDepth, bool justPrint, SingleFileCompileMode mode)
+ bool Compile(List<ProjectNode> nodes, CompilerConfig compiler, ProjectConfig config, int bitDepth, bool justPrint, SingleFileCompileMode mode)
{
- Build(false, nodes, compiler, config, bitDepth, justPrint, mode);
+ return Build(false, nodes, compiler, config, bitDepth, justPrint, mode);
}
#endif
f.Puts("objdir:\n");
f.Puts("\t$(if $(wildcard $(OBJ)),,$(call mkdirq,$(OBJ)))\n");
f.Puts("\t$(if $(ECERE_SDK_SRC),$(if $(wildcard $(call escspace,$(ECERE_SDK_SRC)/crossplatform.mk)),,@$(call echo,Ecere SDK Source Warning: The value of ECERE_SDK_SRC is pointing to an incorrect ($(ECERE_SDK_SRC)/crossplatform.mk) location.)),)\n");
- f.Puts("\t$(if $(ECERE_SDK_SRC),,$(if $(ECP_DEBUG),@$(call echo,ECC Debug Warning: Please define ECERE_SDK_SRC before using ECP_DEBUG),))\n");
- f.Puts("\t$(if $(ECERE_SDK_SRC),,$(if $(ECC_DEBUG),@$(call echo,ECC Debug Warning: Please define ECERE_SDK_SRC before using ECC_DEBUG),))\n");
- f.Puts("\t$(if $(ECERE_SDK_SRC),,$(if $(ECS_DEBUG),@$(call echo,ECC Debug Warning: Please define ECERE_SDK_SRC before using ECS_DEBUG),))\n");
+ f.Puts("\t$(if $(ECERE_SDK_SRC),,$(if $(ECP_DEBUG)$(ECC_DEBUG)$(ECS_DEBUG),@$(call echo,ECC Debug Warning: Please define ECERE_SDK_SRC before using ECP_DEBUG, ECC_DEBUG or ECS_DEBUG),))\n");
//f.Puts("# PRE-BUILD COMMANDS\n");
if(options && options.prebuildCommands)
{
{
MenuDivider { pop };
MenuItem { pop, $"Debug Generate Symbols", l, NotifySelect = FileDebugGenerateSymbols }.disabled = na;
+ MenuItem { pop, $"Debug Precompile", l, NotifySelect = FileDebugPrecompile }.disabled = na;
+ MenuItem { pop, $"Debug Compile", l, NotifySelect = FileDebugCompile }.disabled = na;
}
MenuDivider { pop };
MenuItem { pop, $"New File...", l, Key { l, ctrl = true }, NotifySelect = ProjectNewFile };
if(config)
{
config.compilingModified = false;
- if(!ide.ShouldStopBuild())
+ if(!stopBuild)
config.linkingModified = false;
config.symbolGenModified = false;
buildInProgress = compilingFile;
ide.AdjustBuildMenus();
- project.Compile(nodes, compiler, config, bitDepth, justPrint, mode);
+ result = project.Compile(nodes, compiler, config, bitDepth, justPrint, mode);
buildInProgress = none;
ide.AdjustBuildMenus();
-
- result = true;
}
delete compiler;
}
{
List<ProjectNode> nodes { };
nodes.Add(node);
- Compile(node.project, nodes, mods.ctrl && mods.shift, debugPrecompile);
+ if(node.type == project)
+ ProjectBuild(selection, mods);
+ ide.Update(null);
+ if(!stopBuild)
+ Compile(node.project, nodes, mods.ctrl && mods.shift, debugPrecompile);
delete nodes;
}
return true;
{
List<ProjectNode> nodes { };
nodes.Add(node);
- Compile(node.project, nodes, mods.ctrl && mods.shift, debugCompile);
+ if(node.type == project)
+ ProjectBuild(selection, mods);
+ else
+ Compile(node.project, nodes, mods.ctrl && mods.shift, normal);
+ if(!stopBuild)
+ Compile(node.project, nodes, mods.ctrl && mods.shift, debugCompile);
delete nodes;
}
return true;
{
List<ProjectNode> nodes { };
nodes.Add(node);
- Compile(node.project, nodes, mods.ctrl && mods.shift, debugGenerateSymbols);
+ if(node.type == project)
+ ProjectBuild(selection, mods);
+ else
+ Compile(node.project, nodes, mods.ctrl && mods.shift, normal);
+ if(!stopBuild)
+ Compile(node.project, nodes, mods.ctrl && mods.shift, debugGenerateSymbols);
delete nodes;
}
return true;