defaultCompiler = MakeDefaultCompiler(defaultCompilerName, true);
data.compilerConfigs.Add(defaultCompiler);
}
+ if(!data.compilerConfigsDir || !data.compilerConfigsDir[0])
+ data.property::compilerConfigsDir = "configs";
// We incref the compilers below, so reset refCount to 0
defaultCompiler._refCount = 0;
isset { return projectDefaultIntermediateObjDir && projectDefaultIntermediateObjDir[0]; }
}
- property char * portableLocation
+ property char * compilerConfigsDir
{
- set { delete portableLocation; if(value && value[0]) portableLocation = CopyString(value); }
- get { return portableLocation ? portableLocation : ""; }
- isset { return portableLocation && portableLocation[0]; }
+ set { delete compilerConfigsDir; if(value && value[0]) compilerConfigsDir = CopyString(value); }
+ get { return compilerConfigsDir ? compilerConfigsDir : ""; }
+ isset { return compilerConfigsDir && compilerConfigsDir[0]; }
}
property char * defaultCompiler
char * ideProjectFileDialogLocation;
char * projectDefaultTargetDir;
char * projectDefaultIntermediateObjDir;
- char * portableLocation;
+ char * compilerConfigsDir;
char * defaultCompiler;
CompilerConfig GetCompilerConfig(String compilerName)
delete projectDefaultTargetDir;
delete projectDefaultIntermediateObjDir;
- delete portableLocation;
+ delete compilerConfigsDir;
delete defaultCompiler;
delete ideFileDialogLocation;
if(projectDefaultIntermediateObjDir && projectDefaultIntermediateObjDir[0])
ChangeCh(projectDefaultIntermediateObjDir, from, to);
- if(portableLocation && portableLocation[0])
- ChangeCh(portableLocation, from, to);
+ if(compilerConfigsDir && compilerConfigsDir[0])
+ ChangeCh(compilerConfigsDir, from, to);
}
void ManagePortablePaths(char * location, bool makeAbsolute)
projectDefaultTargetDir = UpdatePortablePath(projectDefaultTargetDir, location, makeAbsolute);
if(projectDefaultIntermediateObjDir && projectDefaultIntermediateObjDir[0])
projectDefaultIntermediateObjDir = UpdatePortablePath(projectDefaultIntermediateObjDir, location, makeAbsolute);
+
+ if(compilerConfigsDir && compilerConfigsDir[0])
+ compilerConfigsDir = UpdatePortablePath(compilerConfigsDir, location, makeAbsolute);
}
char * UpdatePortablePath(char * path, char * location, bool makeAbsolute)
if(compilersTab.modifiedDocument)
{
+ if(strcmp(compilersTab.compilerConfigsDir.path, ideSettings.compilerConfigsDir))
+ ideSettings.compilerConfigsDir = compilersTab.compilerConfigsDir.path;
ideSettings.compilerConfigs.Free();
for(compiler : compilersTab.compilerConfigs)
ideSettings.compilerConfigs.Add(compiler.Copy());
for(compiler : ideSettings.compilerConfigs)
compilersTab.AddCompiler(compiler.Copy(), compiler == activateCompiler);
+ compilersTab.compilerConfigsDir.path = ideSettings.compilerConfigsDir;
// ProjectOptionsTab
projectOptionsTab.defaultTargetDir.path = ideSettings.projectDefaultTargetDir;
background = formColor;
text = $"Compilers";
+ Label compilerConfigsDirLabel { this, position = { 8, 12 }, labeledWindow = compilerConfigsDir, tabCycle = false, inactive = true };
+ PathBox compilerConfigsDir
+ {
+ this, anchor = { left = 210, top = 8, right = 8 };
+ text = $"Compiler Configurations Directory:", browseDialog = toolchainFileDialog, NotifyModified = NotifyModifiedDocument;
+ };
+
SelectorBar compilerSelector
{
- this, text = $"Compiler Configurations:", anchor = { left = 148, top = 8, right = 99 }; size = { 0, 26 };
+ this, text = $"Compiler Configurations:", anchor = { left = 148, top = 38, right = 99 }; size = { 0, 26 };
opacity = 0;
direction = horizontal, scrollable = true;
}
};
- TabControl tabControl { this, background = formColor, anchor = { left = 8, top = 38, right = 8, bottom = 8 } };
+ TabControl tabControl { this, background = formColor, anchor = { left = 8, top = 68, right = 8, bottom = 8 } };
CompilerDirectoriesTab dirsTab { this, tabControl = tabControl };
CompilerToolchainTab toolchainTab { this, tabControl = tabControl };
Label labelCompilers
{
- this, anchor = { left = 8, top = 14 }, labeledWindow = compilerSelector;
+ this, anchor = { left = 8, top = 44 }, labeledWindow = compilerSelector;
void OnRedraw(Surface surface)
{
{
parent = this, bevelOver = true, inactive = true;
size = { 22, 22 };
- anchor = { top = 10, right = 77 };
+ anchor = { top = 40, right = 77 };
hotKey = altC, bitmap = BitmapResource { fileName = ":actions/docNew.png", alphaBlend = true };
bool NotifyClicked(Button button, int x, int y, Modifiers mods)
{
parent = this, bevelOver = true, inactive = true;
size = { 22, 22 };
- anchor = { top = 10, right = 54 };
+ anchor = { top = 40, right = 54 };
hotKey = altC, bitmap = BitmapResource { fileName = ":actions/attach.png", alphaBlend = true };
bool NotifyClicked(Button b, int x, int y, Modifiers mods)
{
parent = this, bevelOver = true, inactive = true;
size = { 22, 22 };
- anchor = { top = 10, right = 31 };
+ anchor = { top = 40, right = 31 };
hotKey = altU, bitmap = BitmapResource { fileName = ":actions/editCopy.png", alphaBlend = true };
bool NotifyClicked(Button button, int x, int y, Modifiers mods)
{
parent = this, bevelOver = true, inactive = true;
size = { 22, 22 };
- anchor = { top = 10, right = 8 };
+ anchor = { top = 40, right = 8 };
hotKey = altD, bitmap = BitmapResource { fileName = ":actions/delete2.png", alphaBlend = true };
bool NotifyClicked(Button button, int x, int y, Modifiers mods)
LoadCompiler((CompilerConfig)clickedButton.id);
return true;
}
+
+ bool NotifyModifiedDocument(PathBox pathBox)
+ {
+ modifiedDocument = true;
+ return true;
+ }
}
Array<String> displayDirectoryNames
extern int __ecereVMethodID_class_OnCompare;
extern int __ecereVMethodID_class_OnFree;
-#ifdef __WIN32__
-define cfDir = "C:/temp/";
-#else
-define cfDir = "/home/redj/.ecereIDE/";
-#endif
-
IDESettings ideSettings;
IDESettingsContainer settingsContainer
}
}
- void CatMakeFileName(char * string, CompilerConfig compiler, ProjectConfig config)
+ void GetCompilerConfigsDir(char * cfDir)
+ {
+ strcpy(cfDir, topNode.path);
+ PathCatSlash(cfDir, ideSettings.compilerConfigsDir);
+ if(cfDir && cfDir[0] && cfDir[strlen(cfDir)-1] != '/')
+ strcat(cfDir, "/");
+ }
+
+ void CatMakeFileName(char * string, ProjectConfig config)
{
char projectName[MAX_LOCATION];
strcpy(projectName, name);
- if(strcmpi(compiler.name, defaultCompilerName))
- sprintf(string, "%s-%s-%s.Makefile", projectName, compiler.name, config.name);
- else
- sprintf(string, "%s%s%s.Makefile", projectName, config ? "-" : "", config ? config.name : "");
+ sprintf(string, "%s%s%s.Makefile", projectName, config ? "-" : "", config ? config.name : "");
}
#ifndef MAKEFILE_GENERATOR
CatTargetFileName(targetFileName, compiler, config);
strcpy(makeFilePath, topNode.path);
- CatMakeFileName(makeFile, compiler, config);
+ CatMakeFileName(makeFile, config);
PathCatSlash(makeFilePath, makeFile);
// TODO: TEST ON UNIX IF \" around makeTarget is ok
{
int len;
char pushD[MAX_LOCATION];
+ char cfDir[MAX_LOCATION];
+ GetCompilerConfigsDir(cfDir);
GetWorkingDir(pushD, sizeof(pushD));
ChangeWorkingDir(topNode.path);
// Create object dir if it does not exist already
}
else
{
+ char cfDir[MAX_LOCATION];
+ GetCompilerConfigsDir(cfDir);
sprintf(command, "%s E_IDE_CF_DIR=%s COMPILER=%s -j%d %s%s%s -C \"%s\" -f \"%s\"", compiler.makeCommand, cfDir, compilerName, numJobs,
compiler.ccacheEnabled ? "CCACHE=y " : "",
compiler.distccEnabled ? "DISTCC=y " : "",
SetPath(false, compiler, config);
strcpy(makeFilePath, topNode.path);
- CatMakeFileName(makeFile, compiler, config);
+ CatMakeFileName(makeFile, config);
PathCatSlash(makeFilePath, makeFile);
if(compiler.type.isVC)
}
else
{
+ char cfDir[MAX_LOCATION];
+ GetCompilerConfigsDir(cfDir);
sprintf(command, "%s E_IDE_CF_DIR=%s COMPILER=%s %sclean -C \"%s\" -f \"%s\"", compiler.makeCommand, cfDir, compilerName, realclean ? "real" : "", topNode.path, makeFilePath);
if((f = DualPipeOpen(PipeOpenMode { output = 1, error = 1, input = 2 }, command)))
{
bool result = false;
char path[MAX_LOCATION];
- GetWorkingDir(path, sizeof(path));
- PathCatSlash(path, cfDir);
+ GetCompilerConfigsDir(path);
+ if(!FileExists(path).isDirectory)
+ MakeDir(path);
PathCatSlash(path, "debug.cf");
- if(!FileExists(path))
+ if(FileExists(path))
+ DeleteFile(path);
{
File f = FileOpen(path, write);
if(f)
bool result = false;
char path[MAX_LOCATION];
- GetWorkingDir(path, sizeof(path));
- PathCatSlash(path, cfDir);
+ GetCompilerConfigsDir(path);
+ if(!FileExists(path).isDirectory)
+ MakeDir(path);
PathCatSlash(path, "crossplatform.cf");
- if(!FileExists(path))
+ if(FileExists(path))
+ DeleteFile(path);
{
File include = FileOpen(":crossplatform.cf", read);
if(include)
CamelCase(compilerName);
name = PrintString(platform, "-", compilerName, ".cf");
- GetWorkingDir(path, sizeof(path));
- PathCatSlash(path, cfDir);
+ GetCompilerConfigsDir(path);
+ if(!FileExists(path).isDirectory)
+ MakeDir(path);
PathCatSlash(path, name);
- if(!FileExists(path))
+ if(FileExists(path))
+ DeleteFile(path);
{
File f = FileOpen(path, write);
if(f)
if(!altMakefilePath)
{
strcpy(filePath, topNode.path);
- CatMakeFileName(makeFile, compiler, config);
+ CatMakeFileName(makeFile, config);
PathCatSlash(filePath, makeFile);
}
DisplayCompiler(compiler, false);
strcpy(makefilePath, project.topNode.path);
- project.CatMakeFileName(makefileName, compiler, config);
+ project.CatMakeFileName(makefileName, config);
PathCatSlash(makefilePath, makefileName);
exists = FileExists(makefilePath);