mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
ide: TDM64 instant setup
git-svn-id: svn://ultimatepp.org/upp/trunk@9098 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
8aef84849f
commit
37fefa3113
8 changed files with 114 additions and 97 deletions
|
|
@ -110,10 +110,6 @@ public:
|
|||
|
||||
Vector() { vector = NULL; items = alloc = 0; }
|
||||
~Vector() {
|
||||
// if(items >= 0 && (alloc - items) * sizeof(T) > 16)
|
||||
// RLOG("~Vector, waste: " << (alloc - items) * sizeof(T)
|
||||
// << ", items: " << items << ", alloc: " << alloc << ", sizeof(T): " << sizeof(T)
|
||||
// << ", " << typeid(T).name()); //TODO remove
|
||||
Free();
|
||||
return; // Constraints:
|
||||
#ifdef CPP_11
|
||||
|
|
|
|||
|
|
@ -193,8 +193,10 @@ One<Builder> MakeBuild::CreateBuilder(Host *host)
|
|||
b->debug_options = Join(bm.Get("COMMON_OPTIONS", ""), bm.Get("DEBUG_OPTIONS", ""));
|
||||
b->release_options = Join(bm.Get("COMMON_OPTIONS", ""), bm.Get("RELEASE_OPTIONS", ""));
|
||||
b->release_size_options = Join(bm.Get("COMMON_OPTIONS", ""), bm.Get("RELEASE_SIZE_OPTIONS", ""));
|
||||
b->common_link = bm.Get("COMMON_LINK", "");
|
||||
b->debug_link = bm.Get("DEBUG_LINK", "");
|
||||
b->release_link = bm.Get("RELEASE_LINK", "");
|
||||
|
||||
b->main_conf = !!main_conf.GetCount();
|
||||
b->allow_pch = bm.Get("ALLOW_PRECOMPILED_HEADERS", "") == "1";
|
||||
b->start_time = start_time;
|
||||
|
|
@ -511,7 +513,8 @@ bool MakeBuild::Build(const Workspace& wspc, String mainparam, String outfile, b
|
|||
|
||||
String mainpackage = wspc[0];
|
||||
Vector<String> linkfile, immfile;
|
||||
String linkopt = GetMethodVars(method).Get(targetmode ? "RELEASE_LINK" : "DEBUG_LINK", Null);
|
||||
String linkopt = Merge(" ", GetMethodVars(method).Get("COMMON_LINK", Null),
|
||||
GetMethodVars(method).Get(targetmode ? "RELEASE_LINK" : "DEBUG_LINK", Null));
|
||||
if(linkopt.GetCount())
|
||||
linkopt << ' ';
|
||||
ok = true;
|
||||
|
|
|
|||
|
|
@ -88,7 +88,8 @@ void CppBuilder::AddMakeFile(MakeFile& makefile, String package,
|
|||
flags << ' ' << Gather(pkg.option, config.GetKeys());
|
||||
makefile.config << "CFLAGS =" << flags << "\n"
|
||||
"CXXFLAGS =" << flags << "\n"
|
||||
"LDFLAGS = " << (HasFlag("DEBUG") ? debug_link : release_link) << " $(LINKOPTIONS)\n"
|
||||
"LDFLAGS = " << Merge(" ", common_link, HasFlag("DEBUG") ? debug_link : release_link)
|
||||
<< " $(LINKOPTIONS)\n"
|
||||
"LIBPATH =";
|
||||
for(int i = 0; i < libpath.GetCount(); i++)
|
||||
makefile.config << " -L" << GetMakePath(AdjustMakePath(GetHostPathQ(libpath[i])));
|
||||
|
|
|
|||
|
|
@ -415,6 +415,7 @@ struct Builder {
|
|||
String debug_options;
|
||||
String release_options;
|
||||
String release_size_options;
|
||||
String common_link;
|
||||
String debug_link;
|
||||
String release_link;
|
||||
String version;
|
||||
|
|
|
|||
|
|
@ -245,7 +245,8 @@ void Gdb::Cpu()
|
|||
while(!ss.IsEof()) {
|
||||
String ln = ss.GetLine();
|
||||
cpu.Add(AttrText(ln).SetFont(Courier(Ctrl::HorzLayoutZoom(12)))
|
||||
.Paper(even ? Blend(SColorMark, SColorPaper, 220) : SColorPaper));
|
||||
.Paper(even ? Blend(SColorMark, SColorPaper, 220) : SColorPaper)
|
||||
.Ink(SColorText));
|
||||
even = !even;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -150,6 +150,8 @@ void InstantSetup()
|
|||
df.Dir(GetProgramsFolder());
|
||||
|
||||
String default_method;
|
||||
|
||||
bool dirty = false;
|
||||
|
||||
for(int x64 = 0; x64 < 2; x64++) {
|
||||
String method = x64 ? "MSC15x64" : "MSC15";
|
||||
|
|
@ -223,71 +225,73 @@ void InstantSetup()
|
|||
bm.GetAdd("LIB") = Join(libs, ";");
|
||||
|
||||
SaveVarFile(ConfigFile(method + ".bm"), bm);
|
||||
dirty = true;
|
||||
|
||||
if(!x64)
|
||||
default_method = "MSC15";
|
||||
}
|
||||
}
|
||||
|
||||
for(int x64 = 0; x64 < 2; x64++) {
|
||||
String m = x64 ? "64" : "32";
|
||||
String method = "MINGW" + m;
|
||||
#ifdef _DEBUG
|
||||
method << "Test";
|
||||
#endif
|
||||
VectorMap<String, String> bm = GetMethodVars(method);
|
||||
|
||||
Vector<String> bins = Split(bm.Get("PATH", ""), ';');
|
||||
Vector<String> incs = Split(bm.Get("INCLUDE", ""), ';');
|
||||
Vector<String> libs = Split(bm.Get("LIB", ""), ';');
|
||||
if(CheckDirs(bins, 2) && CheckDirs(incs, 2) && CheckDirs(libs, 2)) {
|
||||
String bin = GetExeDirFile("bin");
|
||||
if(DirectoryExists(bin + "/TDM64"))
|
||||
for(int x64 = 0; x64 < 2; x64++) {
|
||||
String method = x64 ? "MINGWx64" : "MINGW";
|
||||
#ifdef _DEBUG
|
||||
method << "Test";
|
||||
#endif
|
||||
VectorMap<String, String> bm = GetMethodVars(method);
|
||||
|
||||
Vector<String> bins = Split(bm.Get("PATH", ""), ';');
|
||||
Vector<String> incs = Split(bm.Get("INCLUDE", ""), ';');
|
||||
Vector<String> libs = Split(bm.Get("LIB", ""), ';');
|
||||
if(CheckDirs(bins, 3) && CheckDirs(incs, 2) && CheckDirs(libs, 2)) {
|
||||
if(!x64)
|
||||
default_method = Nvl(default_method, method);
|
||||
continue;
|
||||
}
|
||||
|
||||
bmSet(bm, "BUILDER", "GCC");
|
||||
bmSet(bm, "COMPILER", "");
|
||||
bmSet(bm, "COMMON_OPTIONS", x64 ? "-msse2" : "-msse2 -m32");
|
||||
bmSet(bm, "COMMON_CPP_OPTIONS", "-std=c++11");
|
||||
bmSet(bm, "COMMON_C_OPTIONS", "");
|
||||
bmSet(bm, "COMMON_LINK", x64 ? "" : "-m32");
|
||||
bmSet(bm, "COMMON_FLAGS", "");
|
||||
bmSet(bm, "DEBUG_INFO", "2");
|
||||
bmSet(bm, "DEBUG_BLITZ", "1");
|
||||
bmSet(bm, "DEBUG_LINKMODE", "0");
|
||||
bmSet(bm, "DEBUG_OPTIONS", "-O0 -ggdb");
|
||||
bmSet(bm, "DEBUG_FLAGS", "");
|
||||
bmSet(bm, "DEBUG_LINK", "");
|
||||
bmSet(bm, "RELEASE_BLITZ", "");
|
||||
bmSet(bm, "RELEASE_LINKMODE", "0");
|
||||
bmSet(bm, "RELEASE_OPTIONS", "-O3 -ffunction-sections");
|
||||
bmSet(bm, "RELEASE_SIZE_OPTIONS", "-Os -finline-limit=20 -ffunction-sections");
|
||||
bmSet(bm, "RELEASE_FLAGS", "");
|
||||
bmSet(bm, "RELEASE_LINK", "");
|
||||
bmSet(bm, "DEBUGGER", "gdb");
|
||||
bmSet(bm, "ALLOW_PRECOMPILED_HEADERS", "1");
|
||||
// bmSet(bm, "LINKMODE_LOCK", "0");
|
||||
|
||||
String m = x64 ? "" : "32";
|
||||
bins.At(0) = bin + "/TDM64/bin";
|
||||
bins.At(1) = bin + "/TDM64/opt/bin" + m;
|
||||
bins.At(2) = bin + "/TDM64/gdb" + m + "/bin";
|
||||
incs.At(0) = bin + "/TDM64/i686-w64-mingw32/include";
|
||||
incs.At(1) = bin + "/TDM64/opt/include";
|
||||
libs.At(0) = bin + "/TDM64/i686-w64-mingw32/lib" + m;
|
||||
libs.At(1) = bin + "/TDM64/opt/lib" + m;
|
||||
|
||||
bm.GetAdd("PATH") = Join(bins, ";");
|
||||
bm.GetAdd("INCLUDE") = Join(incs, ";");
|
||||
bm.GetAdd("LIB") = Join(libs, ";");
|
||||
|
||||
SaveVarFile(ConfigFile(method + ".bm"), bm);
|
||||
dirty = true;
|
||||
|
||||
if(!x64)
|
||||
default_method = Nvl(default_method, method);
|
||||
continue;
|
||||
}
|
||||
|
||||
String bin = GetExeDirFile("bin");
|
||||
if(!DirectoryExists(bin + "/mingw" + m))
|
||||
break;
|
||||
|
||||
bmSet(bm, "BUILDER", "GCC");
|
||||
bmSet(bm, "COMPILER", "");
|
||||
bmSet(bm, "COMMON_OPTIONS", "-msse2");
|
||||
bmSet(bm, "COMMON_CPP_OPTIONS", "-std=c++11");
|
||||
bmSet(bm, "COMMON_C_OPTIONS", "");
|
||||
bmSet(bm, "COMMON_FLAGS", "");
|
||||
bmSet(bm, "DEBUG_INFO", "2");
|
||||
bmSet(bm, "DEBUG_BLITZ", "1");
|
||||
bmSet(bm, "DEBUG_LINKMODE", "0");
|
||||
bmSet(bm, "DEBUG_OPTIONS", "-O0 -ggdb");
|
||||
bmSet(bm, "DEBUG_FLAGS", "");
|
||||
bmSet(bm, "DEBUG_LINK", "");
|
||||
bmSet(bm, "RELEASE_BLITZ", "");
|
||||
bmSet(bm, "RELEASE_LINKMODE", "0");
|
||||
bmSet(bm, "RELEASE_OPTIONS", "-O3 -ffunction-sections");
|
||||
bmSet(bm, "RELEASE_SIZE_OPTIONS", "-Os -finline-limit=20 -ffunction-sections");
|
||||
bmSet(bm, "RELEASE_FLAGS", "");
|
||||
bmSet(bm, "RELEASE_LINK", "");
|
||||
bmSet(bm, "DEBUGGER", "gdb");
|
||||
bmSet(bm, "ALLOW_PRECOMPILED_HEADERS", "1");
|
||||
// bmSet(bm, "LINKMODE_LOCK", "0");
|
||||
|
||||
bins.At(0) = bin + "/mingw" + m + "/bin";
|
||||
bins.At(1) = bin + "/mingw" + m + "/opt/bin";
|
||||
incs.At(0) = bin + "/mingw" + m + "/i686-w64-mingw32/include";
|
||||
incs.At(1) = bin + "/mingw" + m + "/opt/include";
|
||||
libs.At(0) = bin + "/mingw" + m + "/i686-w64-mingw32/lib";
|
||||
libs.At(1) = bin + "/mingw" + m + "/opt/lib";
|
||||
|
||||
bm.GetAdd("PATH") = Join(bins, ";");
|
||||
bm.GetAdd("INCLUDE") = Join(incs, ";");
|
||||
bm.GetAdd("LIB") = Join(libs, ";");
|
||||
|
||||
SaveVarFile(ConfigFile(method + ".bm"), bm);
|
||||
|
||||
if(!x64)
|
||||
default_method = Nvl(default_method, method);
|
||||
}
|
||||
|
||||
if(default_method.GetCount())
|
||||
SaveFile(GetExeDirFile("default_method"), default_method);
|
||||
|
|
@ -330,8 +334,16 @@ void InstantSetup()
|
|||
"UPP = " + AsCString(b) + ";\r\n"
|
||||
"OUTPUT = " + AsCString(out) + ";\r\n"
|
||||
);
|
||||
dirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
Ide *ide = dynamic_cast<Ide *>(TheIde());
|
||||
if(dirty && ide) {
|
||||
ide->SyncBuildMode();
|
||||
SyncCodeBase();
|
||||
ide->SetBar();
|
||||
}
|
||||
}
|
||||
|
||||
bool CheckLicense()
|
||||
|
|
|
|||
|
|
@ -391,6 +391,7 @@ void DefaultBuilderSetup::InitSetupCtrlsMap(VectorMap<Id, Ctrl*>& map)
|
|||
map.Add("COMMON_OPTIONS", &common_options);
|
||||
map.Add("COMMON_CPP_OPTIONS", &common_cpp_options);
|
||||
map.Add("COMMON_C_OPTIONS", &common_c_options);
|
||||
map.Add("COMMON_LINK", &common_link_options);
|
||||
map.Add("COMMON_FLAGS", &common_flags);
|
||||
map.Add("DEBUG_INFO", &debug_info);
|
||||
map.Add("DEBUG_BLITZ", &debug_blitz);
|
||||
|
|
|
|||
|
|
@ -228,43 +228,45 @@ LAYOUT(BuildMethodsAndroidBuilderSetupLayout, 648, 500)
|
|||
END_LAYOUT
|
||||
|
||||
LAYOUT(BuildMethodsDefaultBuilderSetupLayout, 648, 500)
|
||||
ITEM(Label, dv___0, SetLabel(t_("&Compiler name:")).LeftPosZ(8, 104).TopPosZ(16, 19))
|
||||
ITEM(EditString, compiler, LeftPosZ(132, 100).TopPosZ(16, 19))
|
||||
ITEM(Label, dv___2, SetLabel(t_("&External debugger:")).LeftPosZ(240, 100).TopPosZ(16, 19))
|
||||
ITEM(EditString, debugger, LeftPosZ(344, 120).TopPosZ(16, 20))
|
||||
ITEM(Label, dv___4, SetLabel(t_("Common options")).LeftPosZ(0, 112).TopPosZ(48, 19))
|
||||
ITEM(EditString, common_options, HSizePosZ(132, 0).TopPosZ(48, 19))
|
||||
ITEM(Label, dv___6, SetLabel(t_("Common C++ options")).LeftPosZ(0, 128).TopPosZ(68, 19))
|
||||
ITEM(EditString, common_cpp_options, HSizePosZ(132, 0).TopPosZ(68, 19))
|
||||
ITEM(Label, dv___8, SetLabel(t_("Common C options")).LeftPosZ(0, 112).TopPosZ(88, 19))
|
||||
ITEM(EditString, common_c_options, HSizePosZ(132, 0).TopPosZ(88, 19))
|
||||
ITEM(Label, dv___10, SetLabel(t_("Common fixed flags")).LeftPosZ(0, 112).TopPosZ(108, 19))
|
||||
ITEM(EditString, common_flags, HSizePosZ(132, 0).TopPosZ(108, 19))
|
||||
ITEM(LabelBox, dv___12, SetLabel(t_("Tools")).HSizePosZ(0, 0).TopPosZ(0, 44))
|
||||
ITEM(Label, dv___13, SetLabel(t_("Default debug info level:")).LeftPosZ(4, 132).TopPosZ(152, 19))
|
||||
ITEM(DropList, debug_info, LeftPosZ(140, 116).TopPosZ(152, 19))
|
||||
ITEM(TextOption, debug_blitz, SetLabel(t_("Use BLITZ")).HSizePosZ(264, 276).TopPosZ(152, 15))
|
||||
ITEM(TextOption, debug_linkmode, SetLabel(t_("All static\nShared libs\nAll shared")).HSizePosZ(376, 12).TopPosZ(152, 15))
|
||||
ITEM(Label, dv___17, SetLabel(t_("Debug options")).LeftPosZ(0, 112).TopPosZ(184, 19))
|
||||
ITEM(Label, dv___0, SetLabel(t_("&Compiler name:")).LeftPosZ(8, 104).TopPosZ(12, 19))
|
||||
ITEM(EditString, compiler, LeftPosZ(132, 100).TopPosZ(12, 19))
|
||||
ITEM(Label, dv___2, SetLabel(t_("&External debugger:")).LeftPosZ(240, 100).TopPosZ(12, 19))
|
||||
ITEM(EditString, debugger, LeftPosZ(344, 120).TopPosZ(12, 20))
|
||||
ITEM(Label, dv___4, SetLabel(t_("Common options")).LeftPosZ(0, 112).TopPosZ(40, 19))
|
||||
ITEM(EditString, common_options, HSizePosZ(132, 0).TopPosZ(40, 19))
|
||||
ITEM(Label, dv___6, SetLabel(t_("Common C++ options")).LeftPosZ(0, 128).TopPosZ(60, 19))
|
||||
ITEM(EditString, common_cpp_options, HSizePosZ(132, 0).TopPosZ(60, 19))
|
||||
ITEM(Label, dv___8, SetLabel(t_("Common C options")).LeftPosZ(0, 112).TopPosZ(80, 19))
|
||||
ITEM(EditString, common_c_options, HSizePosZ(132, 0).TopPosZ(80, 19))
|
||||
ITEM(Label, dv___10, SetLabel(t_("Common link options")).LeftPosZ(0, 124).TopPosZ(100, 19))
|
||||
ITEM(EditString, common_link_options, HSizePosZ(132, 0).TopPosZ(100, 19))
|
||||
ITEM(Label, dv___12, SetLabel(t_("Common fixed flags")).LeftPosZ(0, 112).TopPosZ(120, 19))
|
||||
ITEM(EditString, common_flags, HSizePosZ(132, 0).TopPosZ(120, 19))
|
||||
ITEM(LabelBox, dv___14, SetLabel(t_("Tools")).HSizePosZ(0, 0).TopPosZ(0, 36))
|
||||
ITEM(Label, dv___15, SetLabel(t_("Default debug info level:")).LeftPosZ(4, 132).TopPosZ(156, 19))
|
||||
ITEM(DropList, debug_info, LeftPosZ(140, 116).TopPosZ(156, 19))
|
||||
ITEM(TextOption, debug_blitz, SetLabel(t_("Use BLITZ")).HSizePosZ(264, 276).TopPosZ(156, 19))
|
||||
ITEM(TextOption, debug_linkmode, SetLabel(t_("All static\nShared libs\nAll shared")).HSizePosZ(376, 12).TopPosZ(156, 19))
|
||||
ITEM(Label, dv___19, SetLabel(t_("Debug options")).LeftPosZ(0, 112).TopPosZ(184, 19))
|
||||
ITEM(EditString, debug_options, HSizePosZ(132, 0).TopPosZ(184, 19))
|
||||
ITEM(Label, dv___19, SetLabel(t_("Debug fixed flags")).LeftPosZ(0, 112).TopPosZ(204, 19))
|
||||
ITEM(Label, dv___21, SetLabel(t_("Debug fixed flags")).LeftPosZ(0, 112).TopPosZ(204, 19))
|
||||
ITEM(EditString, debug_flags, HSizePosZ(132, 0).TopPosZ(204, 19))
|
||||
ITEM(Label, dv___21, SetLabel(t_("Debug link options")).LeftPosZ(0, 112).TopPosZ(224, 19))
|
||||
ITEM(Label, dv___23, SetLabel(t_("Debug link options")).LeftPosZ(0, 112).TopPosZ(224, 19))
|
||||
ITEM(EditString, debug_link, HSizePosZ(132, 0).TopPosZ(224, 19))
|
||||
ITEM(TextSwitch, release_linkmode, SetLabel(t_("All static\nShared libs\nAll shared")).HSizePosZ(376, 20).TopPosZ(268, 16))
|
||||
ITEM(LabelBox, dv___24, SetLabel(t_("Release mode defaults")).HSizePosZ(0, 0).TopPosZ(252, 40))
|
||||
ITEM(TextOption, release_blitz, SetLabel(t_("Use BLITZ")).LeftPosZ(8, 256).TopPosZ(268, 15))
|
||||
ITEM(Label, dv___26, SetLabel(t_("Optimize for speed")).LeftPosZ(0, 112).TopPosZ(296, 19))
|
||||
ITEM(EditString, speed_options, HSizePosZ(132, 0).TopPosZ(296, 19))
|
||||
ITEM(Label, dv___28, SetLabel(t_("Optimize for size")).LeftPosZ(0, 112).TopPosZ(316, 19))
|
||||
ITEM(EditString, size_options, HSizePosZ(132, 0).TopPosZ(316, 19))
|
||||
ITEM(Label, dv___30, SetLabel(t_("Release fixed flags")).LeftPosZ(0, 112).TopPosZ(336, 19))
|
||||
ITEM(EditString, release_flags, HSizePosZ(132, 0).TopPosZ(336, 19))
|
||||
ITEM(Label, dv___32, SetLabel(t_("Release link options")).LeftPosZ(0, 112).TopPosZ(356, 19))
|
||||
ITEM(EditString, release_link, HSizePosZ(132, 0).TopPosZ(356, 19))
|
||||
ITEM(TabCtrl, paths, HSizePosZ(0, 0).VSizePosZ(400, 0))
|
||||
ITEM(TextOption, allow_pch, SetLabel(t_("Allow precompiled headers")).LeftPosZ(0, 212).TopPosZ(380, 16))
|
||||
ITEM(LabelBox, dv___36, SetLabel(t_("Debug mode defaults")).HSizePosZ(0, 0).TopPosZ(136, 44))
|
||||
ITEM(TextSwitch, release_linkmode, SetLabel(t_("All static\nShared libs\nAll shared")).HSizePosZ(376, 20).TopPosZ(264, 16))
|
||||
ITEM(LabelBox, dv___26, SetLabel(t_("Release mode defaults")).HSizePosZ(0, 0).TopPosZ(248, 36))
|
||||
ITEM(TextOption, release_blitz, SetLabel(t_("Use BLITZ")).LeftPosZ(8, 256).TopPosZ(264, 15))
|
||||
ITEM(Label, dv___28, SetLabel(t_("Optimize for speed")).LeftPosZ(0, 112).TopPosZ(288, 19))
|
||||
ITEM(EditString, speed_options, HSizePosZ(132, 0).TopPosZ(288, 19))
|
||||
ITEM(Label, dv___30, SetLabel(t_("Optimize for size")).LeftPosZ(0, 112).TopPosZ(308, 19))
|
||||
ITEM(EditString, size_options, HSizePosZ(132, 0).TopPosZ(308, 19))
|
||||
ITEM(Label, dv___32, SetLabel(t_("Release fixed flags")).LeftPosZ(0, 112).TopPosZ(328, 19))
|
||||
ITEM(EditString, release_flags, HSizePosZ(132, 0).TopPosZ(328, 19))
|
||||
ITEM(Label, dv___34, SetLabel(t_("Release link options")).LeftPosZ(0, 112).TopPosZ(348, 19))
|
||||
ITEM(EditString, release_link, HSizePosZ(132, 0).TopPosZ(348, 19))
|
||||
ITEM(TabCtrl, paths, HSizePosZ(0, 0).VSizePosZ(392, 0))
|
||||
ITEM(TextOption, allow_pch, SetLabel(t_("Allow precompiled headers")).LeftPosZ(0, 212).TopPosZ(372, 16))
|
||||
ITEM(LabelBox, dv___38, SetLabel(t_("Debug mode defaults")).HSizePosZ(0, 0).TopPosZ(144, 36))
|
||||
END_LAYOUT
|
||||
|
||||
LAYOUT(ModePaneLayout, 320, 460)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue