Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Deleting the static library before generating it?
oBFusCATed:
--- Quote from: MortenMacFly on September 27, 2012, 05:40:51 pm ---I would say its an issue with the archivar. Check, if GCC's "ar" has something like an option for that. How would you do that on the command line?
--- End quote ---
No option I've checked as I've stated in the first post.
The non-cb build system just deletes all files, I guess it has the same problem,
but I've not checked if there are rm rules added before the ar rules in the generated Makefiles.
Alpha:
--- Quote from: oBFusCATed on September 26, 2012, 12:30:53 pm ---Is it possible to make the build system inside C::B to delete the .a file?
--- End quote ---
I think I can add this functionality. Should deleting the archive (just before recreation) be default behavior, or should it be controlled by a switch?
oBFusCATed:
Default.
Alpha:
Try this patch. (I am not sure what the equivalent Linux command is to only try to delete a file if it exists, so someone else will have to change that.)
--- Code: ---Index: src/plugins/compilergcc/directcommands.cpp
===================================================================
--- src/plugins/compilergcc/directcommands.cpp (revision 8417)
+++ src/plugins/compilergcc/directcommands.cpp (working copy)
@@ -736,6 +736,13 @@
break;
}
wxString compilerCmd = compiler->GetCommand(ct);
+ if (ct == ctLinkStaticCmd) // static libraries should be deleted before recreation
+ {
+ if (platform::windows)
+ compilerCmd.Prepend(wxT("cmd /c if exist $static_output del $static_output\n"));
+ else
+ compilerCmd.Prepend(wxT("rm $static_output\n"));
+ }
compiler->GenerateCommandLine(compilerCmd,
target,
0,
--- End code ---
MortenMacFly:
--- Quote from: Alpha on September 29, 2012, 01:16:36 am ---Try this patch.
--- End quote ---
Why don't you simply use wxRemoveFile?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version