for(p : ide.workspace.projects)
{
node = projectView.GetNodeFromWindow(activeClient, p);
- if(node && projectView.Compile(node))
+ if(node && projectView.Compile(node, mods.ctrl && mods.shift))
{
result = true;
break;
}
}
- bool Build(bool isARun, ProjectNode onlyNode, CompilerConfig compiler, ProjectConfig config)
+ bool Build(bool isARun, ProjectNode onlyNode, CompilerConfig compiler, ProjectConfig config, bool justPrint)
{
bool result = false;
DualPipe f;
// Create object dir if it does not exist already
if(!FileExists(objDirExp.dir).isDirectory)
{
- sprintf(command, "%s CF_DIR=\"%s\"%s%s COMPILER=%s objdir -C \"%s\" -f \"%s\"",
+ sprintf(command, "%s CF_DIR=\"%s\"%s%s COMPILER=%s objdir -C \"%s\"%s -f \"%s\"",
compiler.makeCommand, cfDir,
crossCompiling ? " TARGET_PLATFORM=" : "", targetPlatform,
- compilerName, topNode.path, makeFilePath);
-#ifdef _DEBUG
- PrintLn(command);
- ide.outputView.buildBox.Logf("command: %s\n", command);
-#endif
+ compilerName, topNode.path, justPrint ? " -n" : "", makeFilePath);
+ if(justPrint)
+ ide.outputView.buildBox.Logf("%s\n", command);
Execute(command);
}
GetWorkingDir(oldwd, sizeof(oldwd));
ChangeWorkingDir(topNode.path);
+ // TODO: support justPrint
sprintf(command, "%s /useenv /nologo /logcommands %s.sln %s|Win32", compiler.makeCommand, name, config.name);
- ide.outputView.buildBox.Logf("command: %s\n", command);
-#ifdef _DEBUG
- PrintLn(command);
- ide.outputView.buildBox.Logf("command: %s\n", command);
-#endif
+ if(justPrint)
+ ide.outputView.buildBox.Logf("%s\n", command);
if((f = DualPipeOpen(PipeOpenMode { output = true, error = true, input = true }, command)))
{
ProcessPipeOutputRaw(f);
{
char cfDir[MAX_LOCATION];
GetIDECompilerConfigsDir(cfDir, true, true);
- sprintf(command, "%s CF_DIR=\"%s\"%s%s COMPILER=%s -j%d %s%s%s -C \"%s\" -f \"%s\"",
+ sprintf(command, "%s CF_DIR=\"%s\"%s%s COMPILER=%s -j%d %s%s%s -C \"%s\"%s -f \"%s\"",
compiler.makeCommand, cfDir,
crossCompiling ? " TARGET_PLATFORM=" : "", targetPlatform,
compilerName, numJobs,
compiler.ccacheEnabled ? "CCACHE=y " : "",
compiler.distccEnabled ? "DISTCC=y " : "",
- makeTarget, topNode.path, makeFilePath);
-#ifdef _DEBUG
- PrintLn(command);
- ide.outputView.buildBox.Logf("command: %s\n", command);
-#endif
+ makeTarget, topNode.path, justPrint ? " -n" : "", makeFilePath);
+ if(justPrint)
+ ide.outputView.buildBox.Logf("%s\n", command);
if((f = DualPipeOpen(PipeOpenMode { output = true, error = true, input = true }, command)))
{
- result = ProcessBuildPipeOutput(f, objDirExp, isARun, onlyNode, compiler, config);
+ if(justPrint)
+ {
+ ProcessPipeOutputRaw(f);
+ result = true;
+ }
+ else
+ result = ProcessBuildPipeOutput(f, objDirExp, isARun, onlyNode, compiler, config);
delete f;
}
else
- {
ide.outputView.buildBox.Logf($"Error executing make (%s) command\n", compiler.makeCommand);
-#ifndef _DEBUG
- ide.outputView.buildBox.Logf("command: %s\n", command);
-#endif
- }
}
delete pathBackup;
return result;
}
- void Clean(CompilerConfig compiler, ProjectConfig config, bool realclean)
+ void Clean(CompilerConfig compiler, ProjectConfig config, bool realclean, bool justPrint)
{
char makeFile[MAX_LOCATION];
char makeFilePath[MAX_LOCATION];
GetWorkingDir(oldwd, sizeof(oldwd));
ChangeWorkingDir(topNode.path);
+ // TODO: justPrint support
sprintf(command, "%s /useenv /clean /nologo /logcommands %s.sln %s|Win32", compiler.makeCommand, name, config.name);
- ide.outputView.buildBox.Logf("command: %s\n", command);
-#ifdef _DEBUG
- PrintLn(command);
- ide.outputView.buildBox.Logf("command: %s\n", command);
-#endif
+ if(justPrint)
+ ide.outputView.buildBox.Logf("%s\n", command);
if((f = DualPipeOpen(PipeOpenMode { output = true, error = true, input = true }, command)))
{
ProcessPipeOutputRaw(f);
{
char cfDir[MAX_LOCATION];
GetIDECompilerConfigsDir(cfDir, true, true);
- sprintf(command, "%s CF_DIR=\"%s\"%s%s COMPILER=%s %sclean -C \"%s\" -f \"%s\"",
+ sprintf(command, "%s CF_DIR=\"%s\"%s%s COMPILER=%s %sclean -C \"%s\"%s -f \"%s\"",
compiler.makeCommand, cfDir,
crossCompiling ? " TARGET_PLATFORM=" : "", targetPlatform,
- compilerName, realclean ? "real" : "", topNode.path, makeFilePath);
-#ifdef _DEBUG
- PrintLn(command);
- ide.outputView.buildBox.Logf("command: %s\n", command);
-#endif
+ compilerName, realclean ? "real" : "", topNode.path, justPrint ? " -n": "", makeFilePath);
+ if(justPrint)
+ ide.outputView.buildBox.Logf("%s\n", command);
if((f = DualPipeOpen(PipeOpenMode { output = 1, error = 1, input = 2 }, command)))
{
ide.outputView.buildBox.Tell($"Deleting target and object files...");
- ProcessCleanPipeOutput(f, compiler, config);
+ if(justPrint)
+ ProcessPipeOutputRaw(f);
+ else
+ ProcessCleanPipeOutput(f, compiler, config);
delete f;
ide.outputView.buildBox.Logf($"Target and object files deleted\n");
DirExpression targetDirExp = GetTargetDir(compiler, config);
PathBackup pathBackup { };
- // Build(project, ideMain, true, null);
+ // Build(project, ideMain, true, null, false);
#if defined(__WIN32__)
strcpy(target, topNode.path);
delete target;
}
- void Compile(ProjectNode node, CompilerConfig compiler, ProjectConfig config)
+ void Compile(ProjectNode node, CompilerConfig compiler, ProjectConfig config, bool justPrint)
{
- Build(false, node, compiler, config);
+ Build(false, node, compiler, config, justPrint);
}
#endif
return false;
}
- bool BuildInterrim(Project prj, BuildType buildType, CompilerConfig compiler, ProjectConfig config)
+ bool BuildInterrim(Project prj, BuildType buildType, CompilerConfig compiler, ProjectConfig config, bool justPrint)
{
if(ProjectPrepareForToolchain(prj, normal, true, true, compiler, config))
{
ide.outputView.buildBox.Logf($"Building project %s using the %s configuration...\n", prj.name, GetConfigName(config));
- return Build(prj, buildType, compiler, config);
+ return Build(prj, buildType, compiler, config, justPrint);
}
return false;
}
return result;
}
- bool Build(Project prj, BuildType buildType, CompilerConfig compiler, ProjectConfig config)
+ bool Build(Project prj, BuildType buildType, CompilerConfig compiler, ProjectConfig config, bool justPrint)
{
bool result = true;
Window document;
// TODO: Disabled until problems fixed... is it fixed?
if(buildType == rebuild || (config && config.compilingModified))
- prj.Clean(compiler, config, false);
+ prj.Clean(compiler, config, false, justPrint);
else
{
if(buildType == relink || (config && config.linkingModified))
ide.AdjustBuildMenus();
ide.AdjustDebugMenus();
- result = prj.Build(buildType == run, null, compiler, config);
+ result = prj.Build(buildType == run, null, compiler, config, justPrint);
if(config)
{
config = prj.config;
if(/*prj != project || */!prj.GetConfigIsInDebugSession(config) || !ide.DontTerminateDebugSession($"Project Build"))
{
- BuildInterrim(prj, build, compiler, config);
+ BuildInterrim(prj, build, compiler, config, mods.ctrl && mods.shift);
}
delete compiler;
return true;
ide.outputView.buildBox.Logf($"Relinking project %s using the %s configuration...\n", prj.name, GetConfigName(config));
if(config)
config.linkingModified = true;
- Build(prj, relink, compiler, config);
+ Build(prj, relink, compiler, config, mods.ctrl && mods.shift);
}
}
delete compiler;
config.compilingModified = true;
config.makingModified = true;
}*/ // -- should this still be used depite the new solution of BuildType?
- Build(prj, rebuild, compiler, config);
+ Build(prj, rebuild, compiler, config, mods.ctrl && mods.shift);
}
}
delete compiler;
ide.AdjustBuildMenus();
ide.AdjustDebugMenus();
- prj.Clean(compiler, config, false);
+ prj.Clean(compiler, config, false, mods.ctrl && mods.shift);
buildInProgress = none;
ide.AdjustBuildMenus();
ide.AdjustDebugMenus();
ide.AdjustBuildMenus();
ide.AdjustDebugMenus();
- prj.Clean(compiler, config, true);
+ prj.Clean(compiler, config, true, mods.ctrl && mods.shift);
buildInProgress = none;
ide.AdjustBuildMenus();
ide.AdjustDebugMenus();
return true;
}
- bool Compile(ProjectNode node)
+ bool Compile(ProjectNode node, bool justPrint)
{
bool result = false;
char fileName[MAX_LOCATION];
else
ide.outputView.buildBox.Logf($"Compiling single file %s in project %s...\n", node.name, prj.name);
- prj.Compile(node, compiler, config);
+ prj.Compile(node, compiler, config, justPrint);
buildInProgress = none;
ide.AdjustBuildMenus();
if(row)
{
ProjectNode node = (ProjectNode)row.tag;
- if(!Compile(node))
+ if(!Compile(node, mods.ctrl && mods.shift))
ide.outputView.buildBox.Logf($"File %s is excluded from current build configuration.\n", node.name);
}
return true;
project.Run(args, compiler, config);
/*else if(config.targetType == sharedLibrary || config.targetType == staticLibrary)
MessageBox { master = ide, type = ok, text = "Run", contents = "Shared and static libraries cannot be run like executables." }.Modal();*/
- else if(BuildInterrim(project, run, compiler, config))
+ else if(BuildInterrim(project, run, compiler, config, false))
project.Run(args, compiler, config);
delete args;
delete compiler;
else if(project.GetDebug(config) ||
MessageBox { master = ide, type = okCancel, text = $"Starting Debug", contents = $"Attempting to debug non-debug configuration\nProceed anyways?" }.Modal() == ok)
{
- if(/*!IsProjectModified() ||*/ BuildInterrim(project, start, compiler, config))
+ if(/*!IsProjectModified() ||*/ BuildInterrim(project, start, compiler, config, false))
{
if(compiler.type.isVC)
{
ChangeWorkingDir(project.topNode.path);
sprintf(command, "%s /useenv %s.sln /projectconfig \"%s|Win32\" /command \"%s\"" , "devenv", project.name, config.name, "Debug.Start");
- //ide.outputView.buildBox.Logf("command: %s\n", command);
Execute(command);
ChangeWorkingDir(oldwd);
ProjectConfig config = project.config;
bool result = false;
- if(/*!IsProjectModified() ||*/ BuildInterrim(project, restart, compiler, config))
+ if(/*!IsProjectModified() ||*/ BuildInterrim(project, restart, compiler, config, false))
{
// For Restart, compiler and config will only be used if for
// whatever reason (if at all possible) the Debugger is in a
CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
ProjectConfig config = project.config;
- if((ide.debugger.isActive) || (!buildInProgress && BuildInterrim(project, start, compiler, config)))
+ if((ide.debugger.isActive) || (!buildInProgress && BuildInterrim(project, start, compiler, config, false)))
ide.debugger.StepInto(compiler, config);
delete compiler;
return true;
CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
ProjectConfig config = project.config;
- if((ide.debugger.isActive) || (!buildInProgress && BuildInterrim(project, start, compiler, config)))
+ if((ide.debugger.isActive) || (!buildInProgress && BuildInterrim(project, start, compiler, config, false)))
ide.debugger.StepOver(compiler, config, skip);
delete compiler;