mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-25 14:22:54 -06:00
ide: Developing gc-sections support
git-svn-id: svn://ultimatepp.org/upp/trunk@1855 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
7dc7412885
commit
38a45656b6
4 changed files with 37 additions and 38 deletions
|
|
@ -537,7 +537,9 @@ bool MakeBuild::Build(const Workspace& wspc, String mainparam, String outfile, b
|
|||
}
|
||||
String mainpackage = wspc[0];
|
||||
Vector<String> linkfile;
|
||||
String linkopt;
|
||||
String linkopt = GetMethodVars(method).Get(targetmode ? "RELEASE_LINK" : "DEBUG_LINK", Null);
|
||||
if(linkopt.GetCount())
|
||||
linkopt << ' ';
|
||||
ok = true;
|
||||
int ms = msecs();
|
||||
for(int i = 0; i < build_order.GetCount() && (ok || !stoponerrors); i++) {
|
||||
|
|
|
|||
|
|
@ -290,6 +290,8 @@ bool GccBuilder::BuildPackage(const String& package, Vector<String>& linkfile,
|
|||
}
|
||||
|
||||
linkoptions << Gather(pkg.link, config.GetKeys());
|
||||
if(linkoptions.GetCount())
|
||||
linkoptions << ' ';
|
||||
|
||||
Vector<String> libs = Split(Gather(pkg.library, config.GetKeys()), ' ');
|
||||
linkfile.Append(libs);
|
||||
|
|
|
|||
|
|
@ -188,11 +188,13 @@ BuildMethods::BuildMethods()
|
|||
method.AddCtrl("DEBUG_LINKMODE", debug_linkmode);
|
||||
method.AddCtrl("DEBUG_OPTIONS", debug_options);
|
||||
method.AddCtrl("DEBUG_FLAGS", debug_flags);
|
||||
method.AddCtrl("DEBUG_LINK", debug_link);
|
||||
method.AddCtrl("RELEASE_BLITZ", release_blitz);
|
||||
method.AddCtrl("RELEASE_LINKMODE", release_linkmode);
|
||||
method.AddCtrl("RELEASE_OPTIONS", speed_options);
|
||||
method.AddCtrl("RELEASE_SIZE_OPTIONS", size_options);
|
||||
method.AddCtrl("RELEASE_FLAGS", release_flags);
|
||||
method.AddCtrl("RELEASE_LINK", release_link);
|
||||
method.AddCtrl("DEBUGGER", debugger);
|
||||
method.AddCtrl("PATH", path);
|
||||
method.AddCtrl("INCLUDE", include);
|
||||
|
|
@ -276,43 +278,32 @@ static int sCompare(const Value& v1, const Value& v2)
|
|||
return (String)v1 < (String)v2;
|
||||
}
|
||||
|
||||
static bool IsGccBuilder(String b) { return b == "GCC" || b == "GCC32" || b == "GCC_ARM"; }
|
||||
|
||||
void BuildMethods::NewBuilder()
|
||||
{
|
||||
String b = ~builder;
|
||||
if(IsNull(speed_options)) {
|
||||
if(IsGccBuilder(b))
|
||||
#ifdef PLATFORM_WIN32
|
||||
speed_options <<= "-O3 -ffunction-sections";
|
||||
#else
|
||||
speed_options <<= "-O3";
|
||||
#endif
|
||||
bool gcc = b == "GCC" || b == "GCC32" || b == "GCC_ARM";
|
||||
if(IsNull(speed_options))
|
||||
if(gcc)
|
||||
speed_options <<= "-O3 -ffunction-sections -fdata-sections";
|
||||
else
|
||||
speed_options <<= "-O2";
|
||||
}
|
||||
if(IsNull(size_options)) {
|
||||
if(IsGccBuilder(b))
|
||||
#ifdef PLATFORM_WIN32
|
||||
size_options <<= "-Os -finline-limit=20 -ffunction-sections";
|
||||
#else
|
||||
size_options <<= "-Os -finline-limit=20";
|
||||
#endif
|
||||
if(IsNull(size_options))
|
||||
if(gcc)
|
||||
size_options <<= "-Os -finline-limit=20 -ffunction-sections -fdata-sections";
|
||||
else
|
||||
size_options <<= "-O1";
|
||||
}
|
||||
if(IsNull(debug_options)) {
|
||||
if(IsGccBuilder(b))
|
||||
if(IsNull(debug_options))
|
||||
if(gcc)
|
||||
debug_options <<= "-O0";
|
||||
else
|
||||
debug_options <<= "-Od";
|
||||
}
|
||||
if(IsNull(debugger)) {
|
||||
if(IsGccBuilder(b))
|
||||
if(IsNull(debugger))
|
||||
if(gcc)
|
||||
debugger <<= "gdb";
|
||||
else
|
||||
debugger <<= "msdev";
|
||||
}
|
||||
if(IsNull(release_link) && gcc)
|
||||
release_link <<= "-Wl,--gc-sections";
|
||||
ChangeMethod();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -178,33 +178,37 @@ LAYOUT(BuildMethodsLayout, 724, 560)
|
|||
UNTYPED(debug_linkmode, SetLabel(t_("All static\nShared libs\nAll shared")).HSizePosZ(172, 308).TopPosZ(88, 15))
|
||||
ITEM(Label, dv___10, SetLabel(t_("&Debug options:")).LeftPosZ(164, 100).TopPosZ(112, 19))
|
||||
ITEM(EditString, debug_options, HSizePosZ(264, 284).TopPosZ(112, 19))
|
||||
ITEM(Label, dv___12, SetLabel(t_("&External debugger:")).RightPosZ(116, 96).TopPosZ(4, 19))
|
||||
ITEM(Label, dv___12, SetLabel(t_("Debug fixed flags:")).LeftPosZ(164, 100).TopPosZ(132, 19))
|
||||
ITEM(EditString, debug_flags, HSizePosZ(264, 284).TopPosZ(132, 19))
|
||||
ITEM(Label, dv___14, SetLabel(t_("Debug link options:")).LeftPosZ(164, 100).TopPosZ(152, 19))
|
||||
ITEM(EditString, debug_link, HSizePosZ(264, 284).TopPosZ(152, 19))
|
||||
ITEM(Label, dv___16, SetLabel(t_("&External debugger:")).RightPosZ(116, 96).TopPosZ(4, 19))
|
||||
ITEM(EditString, debugger, RightPosZ(4, 112).TopPosZ(4, 20))
|
||||
ITEM(LabelBox, dv___14, SetLabel(t_("Release mode defaults")).RightPosZ(4, 272).TopPosZ(32, 56))
|
||||
ITEM(LabelBox, dv___18, SetLabel(t_("Release mode defaults")).RightPosZ(4, 272).TopPosZ(32, 56))
|
||||
UNTYPED(release_blitz, SwitchImage(false).SetLabel(t_("&Use BLITZ")).RightPosZ(12, 256).TopPosZ(48, 15))
|
||||
UNTYPED(release_linkmode, SetLabel(t_("All static\nShared libs\nAll shared")).RightPosZ(12, 256).TopPosZ(64, 15))
|
||||
ITEM(Label, dv___17, SetLabel(t_("Optimize for speed:")).RightPosZ(176, 100).TopPosZ(92, 19))
|
||||
ITEM(Label, dv___21, SetLabel(t_("Optimize for speed:")).RightPosZ(176, 100).TopPosZ(92, 19))
|
||||
ITEM(EditString, speed_options, RightPosZ(4, 172).TopPosZ(92, 19))
|
||||
ITEM(Label, dv___19, SetLabel(t_("Optimize for size:")).RightPosZ(176, 100).TopPosZ(112, 19))
|
||||
ITEM(Label, dv___23, SetLabel(t_("Optimize for size:")).RightPosZ(176, 100).TopPosZ(112, 19))
|
||||
ITEM(EditString, size_options, RightPosZ(4, 172).TopPosZ(112, 19))
|
||||
ITEM(Label, dv___21, SetLabel(t_("Debug fixed flags:")).LeftPosZ(164, 100).TopPosZ(132, 19))
|
||||
ITEM(EditString, debug_flags, HSizePosZ(264, 284).TopPosZ(132, 19))
|
||||
ITEM(Label, dv___23, SetLabel(t_("Release fixed flags:")).RightPosZ(176, 100).TopPosZ(132, 19))
|
||||
ITEM(Label, dv___25, SetLabel(t_("Release fixed flags:")).RightPosZ(176, 100).TopPosZ(132, 19))
|
||||
ITEM(EditString, release_flags, RightPosZ(4, 172).TopPosZ(132, 19))
|
||||
ITEM(TabCtrl, paths, HSizePosZ(160, 4).VSizePosZ(156, 140))
|
||||
ITEM(LabelBox, dv___26, SetLabel(t_("Remote host")).HSizePosZ(164, 4).BottomPosZ(40, 96))
|
||||
ITEM(Label, dv___27, SetLabel(t_("&Remote host[:port]:")).LeftPosZ(174, 96).BottomPosZ(98, 19))
|
||||
ITEM(Label, dv___27, SetLabel(t_("Release link options:")).RightPosZ(176, 100).TopPosZ(152, 19))
|
||||
ITEM(EditString, release_link, RightPosZ(4, 172).TopPosZ(152, 19))
|
||||
ITEM(TabCtrl, paths, HSizePosZ(160, 4).VSizePosZ(180, 140))
|
||||
ITEM(LabelBox, dv___30, SetLabel(t_("Remote host")).HSizePosZ(164, 4).BottomPosZ(40, 96))
|
||||
ITEM(Label, dv___31, SetLabel(t_("&Remote host[:port]:")).LeftPosZ(174, 96).BottomPosZ(98, 19))
|
||||
ITEM(EditField, remote_host, HSizePosZ(272, 328).BottomPosZ(99, 19))
|
||||
ITEM(Label, dv___29, SetLabel(t_("&OS type:")).LeftPosZ(174, 80).BottomPosZ(74, 19))
|
||||
ITEM(Label, dv___33, SetLabel(t_("&OS type:")).LeftPosZ(174, 80).BottomPosZ(74, 19))
|
||||
ITEM(DropList, remote_os, HSizePosZ(272, 326).BottomPosZ(75, 19))
|
||||
ITEM(Label, dv___31, SetLabel(t_("File &access:")).LeftPosZ(174, 78).BottomPosZ(51, 19))
|
||||
ITEM(Label, dv___35, SetLabel(t_("File &access:")).LeftPosZ(174, 78).BottomPosZ(51, 19))
|
||||
ITEM(DropList, remote_file_access, HSizePosZ(272, 326).BottomPosZ(53, 19))
|
||||
UNTYPED(remote_path_map, RightPosZ(12, 308).BottomPosZ(49, 71))
|
||||
ITEM(Button, setdefault, SetLabel(t_("&Set as default")).LeftPosZ(4, 152).BottomPosZ(40, 22))
|
||||
ITEM(Button, ok, SetLabel(t_("OK")).RightPosZ(76, 64).BottomPosZ(6, 22))
|
||||
ITEM(Button, cancel, SetLabel(t_("Cancel")).RightPosZ(8, 64).BottomPosZ(6, 22))
|
||||
ITEM(Option, use_target, SetLabel(t_("Store all target files\nin the same directory")).LeftPosZ(4, 148).BottomPosZ(74, 28))
|
||||
ITEM(Label, dv___38, SetLabel(t_("Script file:")).LeftPosZ(4, 54).BottomPosZ(133, 19))
|
||||
ITEM(Label, dv___42, SetLabel(t_("Script file:")).LeftPosZ(4, 54).BottomPosZ(133, 19))
|
||||
ITEM(EditField, scriptfile, LeftPosZ(4, 152).BottomPosZ(113, 19))
|
||||
UNTYPED(linkmode_lock, LeftPosZ(4, 148).TopPosZ(384, 20))
|
||||
END_LAYOUT
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue