9 import "OldIDESettings"
13 enum DirTypes { includes, libraries, executables };
15 define defaultCompilerName = "Default";
17 define defaultObjDirExpression = "obj/$(CONFIG).$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)";
19 char * settingsDirectoryNames[DirTypes] =
26 enum GlobalSettingsChange { none, editorSettings, projectOptions, compilerSettings };
28 enum PathRelationship { unrelated, identical, siblings, subPath, parentPath, insuficientInput, pathEmpty, toEmpty, pathNull, toNull, bothEmpty, bothNull };
29 PathRelationship eString_PathRelated(char * path, char * to, char * pathDiff)
31 PathRelationship result;
32 if(pathDiff) *pathDiff = '\0';
33 if(path && *path && to && *to)
35 char toPart[MAX_FILENAME], toRest[MAX_LOCATION];
36 char pathPart[MAX_FILENAME], pathRest[MAX_LOCATION];
38 strcpy(pathRest, path);
39 for(; toRest[0] && pathRest[0];)
41 SplitDirectory(toRest, toPart, toRest);
42 SplitDirectory(pathRest, pathPart, pathRest);
43 if(!fstrcmp(pathPart, toPart)) result = siblings;
46 if(result == siblings)
48 if(!*toRest && !*pathRest) result = identical;
49 else if(!*pathRest) result = parentPath;
50 else result = subPath;
51 if(pathDiff && result != identical) strcpy(pathDiff, *pathRest == '\0' ? toRest : pathRest);
53 else result = unrelated;
59 if(!*path && !*to) result = bothEmpty;
60 else if(!*path) result = pathEmpty;
61 else result = toEmpty;
63 else if(!path && !to) result = bothNull;
64 else if(!path) result = pathNull;
70 char * CopyValidateMakefilePath(char * path)
72 const int map[] = { 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 7 };
73 const char * vars[] = { "$(MODULE)", "$(CONFIG)", "$(PLATFORM)", "$(COMPILER)", "$(TARGET)", "$(COMPILER_SUFFIX)", "$(DEBUG_SUFFIX)", "$(PROJECT)", "$(CONFIGURATION)", "$(TARGET_PLATFORM)",(char *)0 };
80 copy = CopyString(path);
86 Array<char *> parts { };
93 for(v=0; vars[v]; v++)
95 if(SearchString(&tmp[c], 0, vars[v], false, false) == &tmp[c])
99 parts.Add(vars[map[v]]);
100 c += strlen(vars[v]);
114 for(c=0; c<parts.count; c++) len += strlen(parts[c]);
115 copy = new char[++len];
117 for(c=0; c<parts.count; c++) strcat(copy, parts[c]);
128 void ValidPathBufCopy(char *output, char *input)
131 bool volumePath = false;
133 strcpy(output, input);
134 TrimLSpaces(output, output);
135 TrimRSpaces(output, output);
136 MakeSystemPath(output);
138 if(output[0] && output[1] == ':')
145 char * chars = "*|:\",<>?";
146 char ch, * s = output, * o = output;
147 while((ch = *s++)) { if(!strchr(chars, ch)) *o++ = ch; }
151 if(volumePath && output[0])
156 void RemoveTrailingPathSeparator(char *path)
160 if(len>1 && path[len-1] == DIR_SEP)
164 void BasicValidatePathBoxPath(PathBox pathBox)
166 char path[MAX_LOCATION];
167 ValidPathBufCopy(path, pathBox.path);
168 RemoveTrailingPathSeparator(path);
172 CompilerConfig MakeDefaultCompiler(char * name, bool readOnly)
174 CompilerConfig defaultCompiler
179 GetRuntimePlatform(),
190 incref defaultCompiler;
191 return defaultCompiler;
194 class IDESettingsContainer : GlobalSettings
197 settingsName = "ecereIDESettingsTest";
199 settingsName = "ecereIDE";
202 virtual void OnLoad(GlobalSettingsData data);
204 char moduleLocation[MAX_LOCATION];
207 FileSize settingsFileSize;
209 IDESettingsContainer()
211 char path[MAX_LOCATION];
213 LocateModule(null, moduleLocation);
214 strcpy(path, moduleLocation);
215 StripLastDirectory(moduleLocation, moduleLocation);
216 ChangeCh(moduleLocation, '\\', '/');
217 // PortableApps.com directory structure
218 if((start = strstr(path, "\\App\\EcereSDK\\bin\\ide.exe")))
220 char configFilePath[MAX_LOCATION];
221 char defaultConfigFilePath[MAX_LOCATION];
225 strcpy(configFilePath, path);
226 PathCat(configFilePath, "Data");
227 PathCat(configFilePath, "ecereIDE.ini");
229 strcpy(defaultConfigFilePath, path);
230 PathCat(defaultConfigFilePath, "App");
231 PathCat(defaultConfigFilePath, "DefaultData");
232 PathCat(defaultConfigFilePath, "ecereIDE.ini");
234 if(FileExists(defaultConfigFilePath))
236 if(!FileExists(configFilePath))
238 File f = FileOpen(defaultConfigFilePath, read);
239 f.CopyTo(configFilePath);
243 PathCat(path, "Data");
244 // the forced settings location will only be
245 // used if the running ide's path matches
246 // the PortableApps.com directory structure
247 // and the default ini file is found in
248 // the DefaultData directory
249 settingsLocation = path;
255 void OnAskReloadSettings()
257 /*if(MessageBox { type = YesNo, master = this,
258 text = "Global Settings Modified Externally",
259 contents = "The global settings were modified by another instance.\n"
260 "Would you like to reload them?" }.Modal() == Yes)*/
263 FileSize newSettingsFileSize;
264 FileGetSize(settingsFilePath, &newSettingsFileSize);
265 o = settingsFileSize;
266 n = newSettingsFileSize;
271 GuiApplication app = ((GuiApplication)__thisModule.application);
273 for(w = app.desktop.firstChild; w && (!w.created || !w.visible); w = w.next);
274 MessageBox { master = w, type = ok,
275 text = "Global Settings Modified Externally",
276 contents = "The global settings were modified by another process and a drastic shrinking of the settings file was detected.\n"
277 "The new settings will not be loaded to prevent loss of your ide settings.\n"
278 "Please check your settings file and make sure to save this IDE's global settings if your settings file has been compromised."
285 SettingsIOResult Load()
287 SettingsIOResult result = GlobalSettings::Load();
288 IDESettings data = (IDESettings)this.data;
289 CompilerConfig defaultCompiler = null;
292 this.data = IDESettings { };
294 *dataOwner = this.data;
296 if(result == fileNotCompatibleWithDriver)
299 OldIDESettings oldSettings { };
301 loaded = oldSettings.Load() == success;
305 data = (IDESettings)this.data;
307 for(c : oldSettings.compilerConfigs)
308 data.compilerConfigs.Add(c.Copy());
310 for(s : oldSettings.recentFiles) data.recentFiles.Add(CopyString(s));
311 for(s : oldSettings.recentProjects) data.recentProjects.Add(CopyString(s));
313 data.docDir = oldSettings.docDir;
314 data.ideFileDialogLocation = oldSettings.ideFileDialogLocation;
315 data.ideProjectFileDialogLocation = oldSettings.ideProjectFileDialogLocation;
316 data.useFreeCaret = oldSettings.useFreeCaret;
317 data.showLineNumbers = oldSettings.showLineNumbers;
318 data.caretFollowsScrolling = oldSettings.caretFollowsScrolling;
319 delete data.displayDriver; data.displayDriver = CopyString(oldSettings.displayDriver);
320 data.projectDefaultTargetDir = oldSettings.projectDefaultTargetDir;
321 data.projectDefaultIntermediateObjDir = oldSettings.projectDefaultIntermediateObjDir;
328 if(result == fileNotFound || !data)
330 data = (IDESettings)this.data;
331 data.useFreeCaret = false; //true;
332 data.showLineNumbers = true;
333 data.caretFollowsScrolling = false; //true;
336 // Ensure we have a default compiler
337 defaultCompiler = data.GetCompilerConfig(defaultCompilerName);
340 defaultCompiler = MakeDefaultCompiler(defaultCompilerName, true);
341 data.compilerConfigs.Add(defaultCompiler);
344 // We incref the compilers below, so reset refCount to 0
345 defaultCompiler._refCount = 0;
348 FileGetSize(settingsFilePath, &settingsFileSize);
349 if(data.compilerConfigs)
351 for(c : data.compilerConfigs)
353 CompilerConfig compiler = c;
354 char * cxxCommand = compiler.cxxCommand;
355 if(!cxxCommand || !cxxCommand[0])
356 compiler.cxxCommand = cxxDefaultCommand;
360 if(portable && moduleLocation[0] && FileExists(moduleLocation).isDirectory)
361 data.ManagePortablePaths(moduleLocation, true);
362 data.ForcePathSeparatorStyle(true);
367 SettingsIOResult Save()
369 SettingsIOResult result;
371 IDESettings data = (IDESettings)this.data;
372 Platform runtimePlatform = GetRuntimePlatform();
373 if(portable && moduleLocation[0] && FileExists(moduleLocation).isDirectory)
374 data.ManagePortablePaths(moduleLocation, false);
375 data.ForcePathSeparatorStyle(true);
376 result = GlobalSettings::Save();
377 if(result != success)
378 PrintLn("Error saving IDE settings");
379 if(portable && moduleLocation[0] && FileExists(moduleLocation).isDirectory)
380 data.ManagePortablePaths(moduleLocation, true);
382 FileGetSize(settingsFilePath, &settingsFileSize);
387 class IDESettings : GlobalSettingsData
390 List<CompilerConfig> compilerConfigs { };
391 Array<String> recentFiles { };
392 Array<String> recentProjects { };
393 property char * docDir
395 set { delete docDir; if(value && value[0]) docDir = CopyString(value); }
396 get { return docDir ? docDir : ""; }
397 isset { return docDir && docDir[0]; }
399 property char * ideFileDialogLocation
401 set { delete ideFileDialogLocation; if(value && value[0]) ideFileDialogLocation = CopyString(value); }
402 get { return ideFileDialogLocation ? ideFileDialogLocation : ""; }
403 isset { return ideFileDialogLocation && ideFileDialogLocation[0]; }
405 property char * ideProjectFileDialogLocation
407 set { delete ideProjectFileDialogLocation; if(value && value[0]) ideProjectFileDialogLocation = CopyString(value); }
408 get { return ideProjectFileDialogLocation ? ideProjectFileDialogLocation : ""; }
409 isset { return ideProjectFileDialogLocation && ideProjectFileDialogLocation[0]; }
412 bool showLineNumbers;
413 bool caretFollowsScrolling;
414 char * displayDriver;
416 // TODO: Classify settings
417 //EditorSettings editor { };
419 property char * projectDefaultTargetDir
421 set { delete projectDefaultTargetDir; if(value && value[0]) projectDefaultTargetDir = CopyValidateMakefilePath(value); }
422 get { return projectDefaultTargetDir ? projectDefaultTargetDir : ""; }
423 isset { return projectDefaultTargetDir && projectDefaultTargetDir[0]; }
425 property char * projectDefaultIntermediateObjDir
427 set { delete projectDefaultIntermediateObjDir; if(value && value[0]) projectDefaultIntermediateObjDir = CopyValidateMakefilePath(value); }
428 get { return projectDefaultIntermediateObjDir ? projectDefaultIntermediateObjDir : ""; }
429 isset { return projectDefaultIntermediateObjDir && projectDefaultIntermediateObjDir[0]; }
432 property char * compilerConfigsDir
434 set { delete compilerConfigsDir; if(value && value[0]) compilerConfigsDir = CopyString(value); }
435 get { return compilerConfigsDir ? compilerConfigsDir : ""; }
436 isset { return compilerConfigsDir && compilerConfigsDir[0]; }
439 property char * defaultCompiler
441 set { delete defaultCompiler; if(value && value[0]) defaultCompiler = CopyString(value); }
442 get { return defaultCompiler && defaultCompiler[0] ? defaultCompiler : defaultCompilerName; }
443 isset { return defaultCompiler && defaultCompiler[0]; }
448 char * ideFileDialogLocation;
449 char * ideProjectFileDialogLocation;
450 char * projectDefaultTargetDir;
451 char * projectDefaultIntermediateObjDir;
452 char * compilerConfigsDir;
453 char * defaultCompiler;
455 CompilerConfig GetCompilerConfig(String compilerName)
457 char * name = compilerName && compilerName[0] ? compilerName : defaultCompilerName;
458 CompilerConfig compilerConfig = null;
459 for(compiler : compilerConfigs)
461 if(!strcmp(compiler.name, name))
463 compilerConfig = compiler;
467 if(!compilerConfig && compilerConfigs.count)
468 compilerConfig = compilerConfigs.firstIterator.data;
470 incref compilerConfig;
471 return compilerConfig;
476 compilerConfigs.Free();
477 delete compilerConfigs;
480 recentProjects.Free();
481 delete recentProjects;
484 delete projectDefaultTargetDir;
485 delete projectDefaultIntermediateObjDir;
486 delete compilerConfigsDir;
487 delete defaultCompiler;
489 delete ideFileDialogLocation;
490 delete ideProjectFileDialogLocation;
491 delete displayDriver;
494 void ForcePathSeparatorStyle(bool unixStyle)
498 from = '\\', to = '/';
500 from = '/', to = '\\';
501 if(compilerConfigs && compilerConfigs.count)
504 for(config : compilerConfigs)
506 if(config.includeDirs && config.includeDirs.count)
508 for(i = 0; i < config.includeDirs.count; i++)
510 if(config.includeDirs[i] && config.includeDirs[i][0])
511 ChangeCh(config.includeDirs[i], from, to);
514 if(config.libraryDirs && config.libraryDirs.count)
516 for(i = 0; i < config.libraryDirs.count; i++)
518 if(config.libraryDirs[i] && config.libraryDirs[i][0])
519 ChangeCh(config.libraryDirs[i], from, to);
522 if(config.executableDirs && config.executableDirs.count)
524 for(i = 0; i < config.executableDirs.count; i++)
526 if(config.executableDirs[i] && config.executableDirs[i][0])
527 ChangeCh(config.executableDirs[i], from, to);
532 if(recentFiles && recentFiles.count)
535 for(c = 0; c < recentFiles.count; c++)
537 if(recentFiles[c] && recentFiles[c][0])
538 ChangeCh(recentFiles[c], from, to);
541 if(recentProjects && recentProjects.count)
544 for(c = 0; c < recentProjects.count; c++)
546 if(recentProjects[c] && recentProjects[c][0])
547 ChangeCh(recentProjects[c], from, to);
550 if(docDir && docDir[0])
551 ChangeCh(docDir, from, to);
552 if(ideFileDialogLocation && ideFileDialogLocation[0])
553 ChangeCh(ideFileDialogLocation, from, to);
554 if(ideProjectFileDialogLocation && ideProjectFileDialogLocation[0])
555 ChangeCh(ideProjectFileDialogLocation, from, to);
557 if(projectDefaultTargetDir && projectDefaultTargetDir[0])
558 ChangeCh(projectDefaultTargetDir, from, to);
559 if(projectDefaultIntermediateObjDir && projectDefaultIntermediateObjDir[0])
560 ChangeCh(projectDefaultIntermediateObjDir, from, to);
562 if(compilerConfigsDir && compilerConfigsDir[0])
563 ChangeCh(compilerConfigsDir, from, to);
566 void ManagePortablePaths(char * location, bool makeAbsolute)
569 if(compilerConfigs && compilerConfigs.count)
571 for(config : compilerConfigs)
574 for(t = 0; t < DirTypes::enumSize; t++)
576 Array<String> dirs = null;
577 if(t == executables) dirs = config.executableDirs;
578 else if(t == includes) dirs = config.includeDirs;
579 else if(t == libraries) dirs = config.libraryDirs;
580 if(dirs && dirs.count)
582 for(c = 0; c < dirs.count; c++)
584 if(dirs[c] && dirs[c][0])
585 dirs[c] = UpdatePortablePath(dirs[c], location, makeAbsolute);
591 if(recentFiles && recentFiles.count)
593 for(c = 0; c < recentFiles.count; c++)
595 if(recentFiles[c] && recentFiles[c][0])
596 recentFiles[c] = UpdatePortablePath(recentFiles[c], location, makeAbsolute);
599 if(recentProjects && recentProjects.count)
601 for(c = 0; c < recentProjects.count; c++)
603 if(recentProjects[c] && recentProjects[c][0])
604 recentProjects[c] = UpdatePortablePath(recentProjects[c], location, makeAbsolute);
607 if(docDir && docDir[0])
608 docDir = UpdatePortablePath(docDir, location, makeAbsolute);
609 if(ideFileDialogLocation && ideFileDialogLocation[0])
610 ideFileDialogLocation = UpdatePortablePath(ideFileDialogLocation, location, makeAbsolute);
611 if(ideProjectFileDialogLocation && ideProjectFileDialogLocation[0])
612 ideProjectFileDialogLocation = UpdatePortablePath(ideProjectFileDialogLocation, location, makeAbsolute);
614 if(projectDefaultTargetDir && projectDefaultTargetDir[0])
615 projectDefaultTargetDir = UpdatePortablePath(projectDefaultTargetDir, location, makeAbsolute);
616 if(projectDefaultIntermediateObjDir && projectDefaultIntermediateObjDir[0])
617 projectDefaultIntermediateObjDir = UpdatePortablePath(projectDefaultIntermediateObjDir, location, makeAbsolute);
619 if(compilerConfigsDir && compilerConfigsDir[0])
620 compilerConfigsDir = UpdatePortablePath(compilerConfigsDir, location, makeAbsolute);
623 char * UpdatePortablePath(char * path, char * location, bool makeAbsolute)
628 char p[MAX_LOCATION];
630 PathCatSlash(p, path);
632 output = CopyString(p);
636 PathRelationship rel = eString_PathRelated(path, location, null);
637 if(rel == subPath || rel == identical)
639 char p[MAX_LOCATION];
640 MakePathRelative(path, location, p);
641 if(!*p) strcpy(p, "./");
642 else ChangeCh(p, '\\', '/');
644 output = CopyString(p);
652 void AddRecentFile(char * fileName)
655 char * filePath = CopyString(fileName);
656 ChangeCh(filePath, '\\', '/');
657 for(c = 0; c<recentFiles.count; c++)
659 if(recentFiles[c] && !fstrcmp(recentFiles[c], filePath))
661 recentFiles.Delete((void *)&recentFiles[c]);
665 while(recentFiles.count >= MaxRecent)
666 recentFiles.Delete(recentFiles.GetLast());
667 recentFiles.Insert(null, filePath);
668 //UpdateRecentMenus(owner);
671 void AddRecentProject(char * projectName)
674 char * filePath = CopyString(projectName);
675 ChangeCh(filePath, '\\', '/');
676 for(c = 0; c<recentProjects.count; c++)
678 if(recentProjects[c] && !fstrcmp(recentProjects[c], filePath))
680 recentProjects.Delete((void *)&recentProjects[c]);
684 while(recentProjects.count >= MaxRecent)
685 recentProjects.Delete(recentProjects.GetLast());
686 recentProjects.Insert(null, filePath);
687 //UpdateRecentMenus(owner);
691 static const char * compilerTypeNames[CompilerType] = { "GCC", "TCC", "PCC", "VS8", "VS9", "VS10" };
692 static const char * compilerTypeVersionString[CompilerType] = { "", "", "", "8.00", "9.00", "10.00" };
693 static const char * compilerTypeSolutionFileVersionString[CompilerType] = { "", "", "", "9.00", "10.00", "11.00" };
694 static const char * compilerTypeYearString[CompilerType] = { "", "", "", "2005", "2008", "2010" };
695 static const char * compilerTypeProjectFileExtension[CompilerType] = { "", "", "", "vcproj", "vcproj", "vcxproj" };
696 // TODO: i18n with Array
697 static Array<String> compilerTypeLongNames
699 $"GNU Compiler Collection (GCC) / GNU Make",
700 $"Tiny C Compiler / GNU Make",
701 $"Portable C Compiler / GNU Make",
702 $"Microsoft Visual Studio 2005 (8.0) Compiler",
703 $"Microsoft Visual Studio 2008 (9.0) Compiler",
704 $"Microsoft Visual Studio 2010 (10.0) Compiler"
706 const CompilerType firstCompilerType = gcc;
707 const CompilerType lastCompilerType = vs10;
708 public enum CompilerType
710 gcc, tcc, pcc, vs8, vs9, vs10;
714 get { return this == vs8 || this == vs9 || this == vs10; }
719 get { return OnGetString(null, null, null); }
725 for(c = firstCompilerType; c <= lastCompilerType; c++)
726 if(!strcmpi(value, compilerTypeNames[c]))
733 property char * longName { get { return OnGetString(null, (void*)1, null); } };
734 property char * versionString { get { return OnGetString(null, (void*)2, null); } };
735 property char * yearString { get { return OnGetString(null, (void*)3, null); } };
736 property char * projectFileExtension { get { return OnGetString(null, (void*)4, null); } };
737 property char * solutionFileVersionString { get { return OnGetString(null, (void*)5, null); } };
739 char * OnGetString(char * tempString, void * fieldData, bool * needClass)
741 if(this >= firstCompilerType && this <= lastCompilerType)
744 strcpy(tempString, compilerTypeNames[this]);
745 if(fieldData == null)
746 return compilerTypeNames[this];
747 else if(fieldData == (void*)1)
748 return compilerTypeLongNames[this];
749 else if(fieldData == (void*)2)
750 return compilerTypeVersionString[this];
751 else if(fieldData == (void*)3)
752 return compilerTypeYearString[this];
753 else if(fieldData == (void*)4)
754 return compilerTypeProjectFileExtension[this];
755 else if(fieldData == (void*)5)
756 return compilerTypeSolutionFileVersionString[this];
774 name = CopyString(value);
780 Platform targetPlatform;
782 property char * makeCommand
784 set { delete makeCommand; if(value && value[0]) makeCommand = CopyString(value); }
785 get { return makeCommand; }
786 isset { return makeCommand && makeCommand[0]; }
788 property char * ecpCommand
790 set { delete ecpCommand; if(value && value[0]) ecpCommand = CopyString(value); }
791 get { return ecpCommand; }
792 isset { return ecpCommand && ecpCommand[0]; }
794 property char * eccCommand
796 set { delete eccCommand; if(value && value[0]) eccCommand = CopyString(value); }
797 get { return eccCommand; }
798 isset { return eccCommand && eccCommand[0]; }
800 property char * ecsCommand
802 set { delete ecsCommand; if(value && value[0]) ecsCommand = CopyString(value); }
803 get { return ecsCommand; }
804 isset { return ecsCommand && ecsCommand[0]; }
806 property char * earCommand
808 set { delete earCommand; if(value && value[0]) earCommand = CopyString(value); }
809 get { return earCommand; }
810 isset { return earCommand && earCommand[0]; }
812 property char * cppCommand
814 set { delete cppCommand; if(value && value[0]) cppCommand = CopyString(value); }
815 get { return cppCommand; }
816 isset { return cppCommand && cppCommand[0]; }
818 property char * ccCommand
820 set { delete ccCommand; if(value && value[0]) ccCommand = CopyString(value); }
821 get { return ccCommand; }
822 isset { return ccCommand && ccCommand[0]; }
824 property char * cxxCommand
826 set { delete cxxCommand; if(value && value[0]) cxxCommand = CopyString(value); }
827 get { return cxxCommand; }
828 isset { return cxxCommand && cxxCommand[0]; }
830 property char * execPrefixCommand // <-- old name for json ide settings file compatibility
832 set { delete executableLauncher; if(value && value[0]) executableLauncher = CopyString(value); }
833 get { return executableLauncher; }
834 isset { return executableLauncher && executableLauncher[0]; }
836 // TODO: implement CompilerConfig::windresCommand
840 property bool supportsBitDepth { set { } get { return true; } isset { return false; } }
842 property char * distccHosts
844 set { delete distccHosts; if(value && value[0]) distccHosts = CopyString(value); }
845 get { return distccHosts; }
846 isset { return distccHosts && distccHosts[0]; }
848 property char * gccPrefix // <-- old name for json ide settings file compatibility
850 set { delete gnuToolchainPrefix; if(value && value[0]) gnuToolchainPrefix = CopyString(value); }
851 get { return gnuToolchainPrefix; }
852 isset { return gnuToolchainPrefix && gnuToolchainPrefix[0]; }
854 property char * sysroot
856 set { delete sysroot; if(value && value[0]) sysroot = CopyString(value); }
857 get { return sysroot; }
858 isset { return sysroot && sysroot[0]; }
860 property Array<String> includeDirs
871 get { return includeDirs; }
872 isset { return includeDirs.count != 0; }
874 property Array<String> libraryDirs
885 get { return libraryDirs; }
886 isset { return libraryDirs.count != 0; }
888 property Array<String> executableDirs
892 executableDirs.Free();
895 delete executableDirs;
896 executableDirs = value;
899 get { return executableDirs; }
900 isset { return executableDirs.count != 0; }
902 property Array<NamedString> environmentVars
906 environmentVars.Free();
909 delete environmentVars;
910 environmentVars = value;
913 get { return environmentVars; }
914 isset { return environmentVars.count != 0; }
916 property Array<String> prepDirectives
920 prepDirectives.Free();
923 delete prepDirectives;
924 prepDirectives = value;
927 get { return prepDirectives; }
928 isset { return prepDirectives.count != 0; }
930 property Array<String> excludeLibs
941 get { return excludeLibs; }
942 isset { return excludeLibs.count != 0; }
944 property Array<String> compilerFlags
948 compilerFlags.Free();
951 delete compilerFlags;
952 compilerFlags = value;
955 get { return compilerFlags; }
956 isset { return compilerFlags.count != 0; }
958 property Array<String> linkerFlags
969 get { return linkerFlags; }
970 isset { return linkerFlags.count != 0; }
973 Array<String> includeDirs { };
974 Array<String> libraryDirs { };
975 Array<String> executableDirs { };
976 // TODO: Can JSON parse and serialize maps?
977 //EnvironmentVariables { };
978 Array<NamedString> environmentVars { };
979 Array<String> prepDirectives { };
980 Array<String> excludeLibs { };
981 Array<String> compilerFlags { };
982 Array<String> linkerFlags { };
992 char * executableLauncher;
994 char * gnuToolchainPrefix;
998 struct { Array<String> includes, libraries, executables; };
999 Array<String> dirs[DirTypes];
1013 delete executableLauncher;
1015 delete gnuToolchainPrefix;
1017 if(environmentVars) environmentVars.Free();
1018 if(includeDirs) { includeDirs.Free(); }
1019 if(libraryDirs) { libraryDirs.Free(); }
1020 if(executableDirs) { executableDirs.Free(); }
1021 if(prepDirectives) { prepDirectives.Free(); }
1022 if(excludeLibs) { excludeLibs.Free(); }
1023 if(compilerFlags) { compilerFlags.Free(); }
1024 if(linkerFlags) { linkerFlags.Free(); }
1026 CompilerConfig Copy()
1051 for(s : includeDirs) copy.includeDirs.Add(CopyString(s));
1052 for(s : libraryDirs) copy.libraryDirs.Add(CopyString(s));
1053 for(s : executableDirs) copy.executableDirs.Add(CopyString(s));
1054 for(ns : environmentVars) copy.environmentVars.Add(NamedString { name = ns.name, string = ns.string });
1055 for(s : prepDirectives) copy.prepDirectives.Add(CopyString(s));
1056 for(s : excludeLibs) copy.excludeLibs.Add(CopyString(s));
1057 for(s : compilerFlags) copy.compilerFlags.Add(CopyString(s));
1058 for(s : linkerFlags) copy.linkerFlags.Add(CopyString(s));