cbp2make
cbp2make copied to clipboard
When include files ues environment constants slash escaping fails
I have such example of include dirs:
INC = -I$(WXWIN)\include -I$(PYTHONHOME)\include -I$(WXCURL)\include
where environmental constants are used. As we see here, backslash is not escaped. Must be:
INC = -I$(WXWIN)\\include -I$(PYTHONHOME)\\include -I$(WXCURL)\\include
Could you please attach a sample .cbp project with such paths/variables?
I've compiled version from git - there is no such problem there. But... Codeblocks clears "lib" prefix and ".a" extension. For example, if I have such list:
<Add library="libversion.a" />
<Add library="libole32.a" />
<Add library="libkernel32.a" />
<Add library="libuser32.a" />
<Add library="libgdi32.a" />
<Add library="libwinspool.a" />
you script will not work. I've fixed that, added some additional properties.
Another thing, that matters, the order of libs. I couldn't determine whether your script takes it in account (target libs BEFORE, or AFTER main libs).
And the last problem I have, I can't understand why includes in some cases not work from make. But if I do:
make release > run.cmd
and then
run.cmd
it works ok. What the hell it can be?
I don't know offhand, this requires a little investigation. Anyway, I need a complete .cbp file to feed it to cbp2make and also cbp2make.cfg (if you have made any changes to it) and your command line for running cbp2make.
The initial issue about library prefixes may either indicate a real bug or may be related to incorrect Platform/OS option. If you want a Windows makefile, you must use -windows option. Considering the order of libraries, I can't tell for sure, I know this feature is definitely implemented for project options, maybe I have implemented this for libraries too.
-windows option not help, this is not included into functionality of your software. I added a function and also made several changes to your software and now everything compiles ok.
erasing "lib" prefix function:
CString EraseLib(const CString& FileName, const CString& strLib) {
CString strPath = "";
CString strFileName = FileName;
strPath = ExtractFilePath(FileName);
strFileName = ExtractFileName(FileName);
if (0 == FindStr(strFileName, strLib))
{
if (0 == strPath.GetLength())
return SubStr(strFileName, 3, FileName.GetLength());
else
return IncludeTrailingPathDelimiter(strPath) +
SubStr(strFileName, 3, FileName.GetLength());
}
else
return FileName;
}
if you need whole patch, let me know.
Thank you
Hi, can you retest a recent revision of cbp2make against your case? The logic behind library options is following:
- if a library path is not empty, i.e. points exactly to a particular file, this library name must be included as-is; otherwise
- if a library extension is known, clear both prefix (e.g. "lib") and extension (e.g. ".a",".so",".dll");
- include only base library name via link switch;