Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
Compiler Search Dirs are overwritten using cfg->Read
(1/1)
mariocup:
Hi,
if a compiler is added in plugins\compilergcc and the include dirs are set to empty in AutoDetectResult:
AddIncludeDir(wxEmptyString);
AddLibDir(wxEmptyString);
AddResourceIncludeDir(wxEmptyString);
then codeblocks will show empty search dirs for this compiler (in the settings/compiler and debugger) at the first start. Then codeblocks write the configuration file default.conf in APPDATA when closing codeblocks.
If codeblocks is started again, then the default.conf is read and in sdk/compiler.gcc the settings are overwritten in
--- Code: ---void Compiler::LoadSettings(const wxString& baseKey)
...
SetIncludeDirs(GetArrayFromString(cfg->Read(tmp + _T("/include_dirs"), m_MasterPath + sep + _T("include"))));
SetResourceIncludeDirs(GetArrayFromString(cfg->Read(tmp + _T("/res_include_dirs"), m_MasterPath + sep + _T("include"))));
SetLibDirs(GetArrayFromString(cfg->Read(tmp + _T("/library_dirs"), m_MasterPath + sep + _T("lib"))));
--- End code ---
I think if the entry in default.conf does not exists for the compiler or is empty it should be left empty.
SetIncludeDirs(GetArrayFromString(cfg->Read(tmp + _T("/include_dirs"), wxEmptyString)));
Bye,
Mario
mandrav:
Hi Mario,
--- Quote ---if a compiler is added in plugins\compilergcc and the include dirs are set to empty in AutoDetectResult:
AddIncludeDir(wxEmptyString);
AddLibDir(wxEmptyString);
AddResourceIncludeDir(wxEmptyString);
--- End quote ---
You should avoid adding empty dirs (this may have to do with the other bug you posted where there was a stray -I in the command line). If you don't want any dirs added then don't add any.
--- Quote ---I think if the entry in default.conf does not exists for the compiler or is empty it should be left empty.
SetIncludeDirs(GetArrayFromString(cfg->Read(tmp + _T("/include_dirs"), wxEmptyString)));
--- End quote ---
You have a point here. It will be corrected.
Navigation
[0] Message Index
Go to full version