@morten:
@@ -100,7 +100,7 @@ void CompileTargetBase::SetImportLibraryFilename(const wxString& filename)
{
if (filename.IsEmpty())
{
- m_ImportLibraryFilename = _T("$(TARGET_NAME)");
+ m_ImportLibraryFilename = _T("lib$(TARGET_OUTPUT_BASENAME).a");
SetModified(true);
return;
}
@@ -114,7 +114,7 @@ void CompileTargetBase::SetDefinitionFileFilename(const wxString& filename)
{
if (filename.IsEmpty())
{
- m_DefinitionFileFilename = _T("$(TARGET_NAME)");
+ m_DefinitionFileFilename = _T("$(TARGET_OUTPUT_BASENAME).def");
SetModified(true);
return;
}
I believe this cause the issue.
I have debugged how the link command was generated, and found that:
switch (target->GetTargetType())
{
case ttDynamicLib:
{
TargetFilenameGenerationPolicy PrefixPolicy;
TargetFilenameGenerationPolicy ExtensionPolicy;
target->GetTargetFilenameGenerationPolicy(PrefixPolicy, ExtensionPolicy);
wxString importLibraryFileNameString(target->GetDynamicLibImportFilename());
Manager::Get()->GetMacrosManager()->ReplaceMacros(importLibraryFileNameString, target);
wxFileName importLibraryFileName(importLibraryFileNameString);
// apply prefix if needed
if ( (PrefixPolicy == tgfpPlatformDefault)
&& !importLibraryFileName.GetName().StartsWith(compiler->GetSwitches().libPrefix) )
importLibraryFileName.SetName(compiler->GetSwitches().libPrefix + importLibraryFileName.GetName());
// apply extension if needed
if (ExtensionPolicy == tgfpPlatformDefault)
{
wxString current_ext = importLibraryFileName.GetExt();
wxString requested_ext = compiler->GetSwitches().libExtension;
if (!current_ext.IsSameAs(requested_ext, false))
importLibraryFileName.SetFullName(importLibraryFileName.GetFullName() + wxFILE_SEP_EXT + requested_ext);
}
result = UnixFilename(importLibraryFileName.GetFullPath());
QuoteStringIfNeeded(result);
FixPathSeparators(compiler, result);
m_StaticOutput[target] = result;
Here, the target is sdk, and I see the importLibraryFileNameString is "lib$(TARGET_OUTPUT_BASENAME).a", which finally becomes "libcodeblocks.a", and finally the command generator have such code:
"g++.exe -shared -Wl,--output-def=$def_output -Wl,--out-implib=$static_output -Wl,--dll -Lbase\\tinyxml -LE:\\code\\cb\\wxWidgets-2.8.12\\lib\\gcc_dll -Ldevel -Lsdk\\scripting\\lib -Lsdk\\propgrid .objs\\sdk\\co"...
and the value $static_output is replaced by "libcodeblocks.a", but it should be "devel\libcodeblocks.a" before rev7940.
BTW:
When debugging, I found a some code when the command generator try to generate the compile command, but I see for each file, there is always some function call like:
macro.Replace(_T("$static_output"), m_StaticOutput[target]);
The interesting thing is, the value "macro" is always "g++.exe", and I believe it have no change to do a replacement actually. So it just waste some CPU cycles. Any comments.