User forums > Help
Issue about saving the cbp project file
ollydbg:
Steps to reproduce: (WinXP)
1, open a clean Codeblocks.cbp in a recent debugger branch nightly build.
2, change the command argument for src, like adding "-p=debugCC".
3, close this project.
Now, I can see that:
1, The EOL changing from CRLF to LF
2, There are many other changes like:
--- Code: ---Index: E:/code/cb/cb_trunk/src/CodeBlocks.cbp
===================================================================
--- E:/code/cb/cb_trunk/src/CodeBlocks.cbp (revision 7781)
+++ E:/code/cb/cb_trunk/src/CodeBlocks.cbp (working copy)
@@ -24,7 +24,7 @@
</Linker>
</Target>
<Target title="tinyXML">
- <Option output="base\tinyxml\txml" prefix_auto="1" extension_auto="1" />
+ <Option output="base\tinyxml\libtxml" prefix_auto="1" extension_auto="1" />
<Option working_dir="" />
<Option type="2" />
<Option compiler="gcc" />
@@ -60,7 +60,7 @@
</Compiler>
</Target>
<Target title="Squirrel">
- <Option output="sdk\scripting\lib\squirrel" prefix_auto="1" extension_auto="1" />
+ <Option output="sdk\scripting\lib\libsquirrel" prefix_auto="1" extension_auto="1" />
<Option working_dir="" />
<Option type="2" />
<Option compiler="gcc" />
@@ -74,7 +74,7 @@
</Linker>
</Target>
<Target title="Squirrel std lib">
- <Option output="sdk\scripting\lib\sqstdlib" prefix_auto="1" extension_auto="1" />
+ <Option output="sdk\scripting\lib\libsqstdlib" prefix_auto="1" extension_auto="1" />
<Option working_dir="" />
<Option external_deps="sdk\scripting\lib\libsquirrel.a;" />
<Option type="2" />
@@ -89,7 +89,7 @@
</Linker>
</Target>
<Target title="SqPlus">
- <Option output="sdk\scripting\lib\sqplus" prefix_auto="1" extension_auto="1" />
+ <Option output="sdk\scripting\lib\libsqplus" prefix_auto="1" extension_auto="1" />
<Option working_dir="" />
<Option external_deps="sdk\scripting\lib\libsquirrel.a;sdk\scripting\lib\libsqstdlib.a;" />
<Option type="2" />
@@ -104,7 +104,7 @@
</Linker>
</Target>
<Target title="scintilla">
- <Option output="devel\wxscintilla_cb" prefix_auto="1" extension_auto="1" />
+ <Option output="devel\libwxscintilla_cb" prefix_auto="1" extension_auto="1" />
<Option working_dir="" />
<Option type="2" />
<Option compiler="gcc" />
@@ -205,7 +205,7 @@
<Option external_deps="devel\libcodeblocks.a;" />
<Option type="0" />
<Option compiler="gcc" />
- <Option parameters="--debug-log --no-dde --no-check-associations --multiple-instance --no-splash-screen" />
+ <Option parameters="--debug-log --no-dde --no-check-associations --multiple-instance --no-splash-screen -p=debugCC" />
<Option projectLinkerOptionsRelation="2" />
<Compiler>
<Add option="-DBUILDING_PLUGIN" />
@@ -316,7 +316,7 @@
</Linker>
</Target>
<Target title="Compiler depslib">
- <Option output="plugins\compilergcc\depslib\depslib" prefix_auto="1" extension_auto="1" />
+ <Option output="plugins\compilergcc\depslib\libdepslib" prefix_auto="1" extension_auto="1" />
<Option working_dir="" />
<Option type="2" />
<Option compiler="gcc" />
--- End code ---
So, Can I have some methods to solve this?
Thank you.
MortenMacFly:
--- Quote from: ollydbg on February 06, 2012, 01:50:51 am ---So, Can I have some methods to solve this?
--- End quote ---
A known annoyance: The prefix policy is not correctly applied when the project file is saved. IIRC this is not easily possible because it depends on the compiler settings and a the point where this is written, you don't have access to the compiler (I might be wrong though!!!).
However, it doesn't really matter as C::B will handle this later (on load) just fine.
oBFusCATed:
--- Quote from: MortenMacFly on February 06, 2012, 09:52:50 am ---However, it doesn't really matter as C::B will handle this later (on load) just fine.
--- End quote ---
Hm, it matters a lot, because if you're not careful you'll do a useless commit.
Can you please give a better explanation, because I don't think I understood the reason for the bug?
MortenMacFly:
--- Quote from: oBFusCATed on February 06, 2012, 10:20:02 am ---Can you please give a better explanation, because I don't think I understood the reason for the bug?
--- End quote ---
Have a look at:
ProjectLoader::ExportTargetAsProject(const wxString& filename, const wxString& onlyTarget, TiXmlElement* pExtensions)
While you do know the extension of the output file by its type, for the prefix you would need access to the compiler to query if and what prefix to apply to dynamic / static libraries.
It's simply not done, have a look at the code starting here:
if (target->GetTargetType() != ttCommandsOnly)
What's missing i something like:
--- Code: --- if (prefixPolicy == tgfpPlatformDefault)
{
if (outputFileName.StartsWith(LIB_PREFIX_BY_COMPILER))
outputFileName = OUTPUT_FILE_NAME_WO_PREFIX;
}
--- End code ---
MortenMacFly:
--- Quote from: MortenMacFly on February 06, 2012, 10:43:15 am ---
--- Code: --- if (prefixPolicy == tgfpPlatformDefault)
{
if (outputFileName.StartsWith(LIB_PREFIX_BY_COMPILER))
outputFileName = OUTPUT_FILE_NAME_WO_PREFIX;
}
--- End code ---
--- End quote ---
...a better quick hack:
--- Code: --- if ( prefixPolicy == tgfpPlatformDefault
&& ( (!platform::windows && target->GetTargetType() == ttDynamicLib)
|| (target->GetTargetType() == ttStaticLib) ) )
{
wxString compilerId = target->GetCompilerID();
Compiler* compiler = CompilerFactory::GetCompiler(compilerId);
if (compiler)
{
wxString compilerLibPrefix(compiler->GetSwitches()->libPrefix);
wxString outputFileNameWOPrefix;
if (outputFileName.StartsWith(compilerLibPrefix))
outputFileNameWOPrefix = outputFileName.Mid(compilerLibPrefix.Len());
if (!outputFileNameWOPrefix.IsEmpty())
outputFileName = outputFileNameWOPrefix;
}
}
--- End code ---
NOT TESTED, NOT EVEN COMPILED!
...but something like this is needed.
EDIT: Fixed an obvious error, even in pseudo-code ;-)
Navigation
[0] Message Index
[#] Next page
Go to full version