mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-02 08:12:42 -06:00
ide: MAIN_CONF now only defined if any main.confs are present
git-svn-id: svn://ultimatepp.org/upp/trunk@6494 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
0b2d39224b
commit
5aee64dbc7
4 changed files with 12 additions and 6 deletions
|
|
@ -135,6 +135,7 @@ One<Builder> MakeBuild::CreateBuilder(Host *host)
|
|||
b->debug_link = bm.Get("DEBUG_LINK", "");
|
||||
b->release_link = bm.Get("RELEASE_LINK", "");
|
||||
b->script = bm.Get("SCRIPT", "");
|
||||
b->main_conf = !!main_conf.GetCount();
|
||||
return b;
|
||||
}
|
||||
|
||||
|
|
@ -377,17 +378,18 @@ bool MakeBuild::Build(const Workspace& wspc, String mainparam, String outfile, b
|
|||
BeginBuilding(true, clear_console);
|
||||
bool ok = true;
|
||||
if(wspc.GetCount()) {
|
||||
String main_conf;
|
||||
for(int i = 0; i < wspc.GetCount(); i++) {
|
||||
const Package& pk = wspc.package[i];
|
||||
for(int j = 0; j < pk.GetCount(); j++)
|
||||
if(pk[j] == "main.conf") {
|
||||
String pn = wspc[i];
|
||||
main_conf << "// " << pn << "\r\n"
|
||||
<< LoadFile(SourcePath(pn, "main.conf")) << "\r\n";
|
||||
String p = SourcePath(pn, "main.conf");
|
||||
main_conf << "// " << pn << "\r\n" << LoadFile(p) << "\r\n";
|
||||
PutConsole("Found " + p);
|
||||
}
|
||||
}
|
||||
{
|
||||
|
||||
if(main_conf.GetCount()) {
|
||||
VectorMap<String, String> bm = GetMethodVars(method);
|
||||
One<Host> host = CreateHost(false);
|
||||
One<Builder> b = CreateBuilder(~host);
|
||||
|
|
@ -397,6 +399,7 @@ bool MakeBuild::Build(const Workspace& wspc, String mainparam, String outfile, b
|
|||
String path = AppendFileName(outdir, "main.conf.h");
|
||||
RealizePath(path);
|
||||
SaveChangedFile(path, main_conf);
|
||||
PutConsole("Saving " + path);
|
||||
add_includes << outdir << ';';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ struct MakeBuild {
|
|||
bool use_target;
|
||||
String mainconfigparam;
|
||||
String add_includes;
|
||||
String main_conf;
|
||||
|
||||
const TargetMode& GetTargetMode();
|
||||
Index<String> PackageConfig(const Workspace& wspc, int package, const VectorMap<String, String>& bm,
|
||||
|
|
|
|||
|
|
@ -393,7 +393,8 @@ String CppBuilder::DefinesTargetTime(const char *sep, const String& package, con
|
|||
cc << sep << "bmHOUR=" << (int)t.hour;
|
||||
cc << sep << "bmMINUTE=" << (int)t.minute;
|
||||
cc << sep << "bmSECOND=" << (int)t.second;
|
||||
cc << sep << "MAIN_CONF";
|
||||
if(main_conf)
|
||||
cc << sep << "MAIN_CONF";
|
||||
targettime = GetFileTime(target);
|
||||
return cc;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -385,6 +385,7 @@ struct Builder {
|
|||
String script;
|
||||
String mainpackage;
|
||||
bool doall;
|
||||
bool main_conf;
|
||||
|
||||
virtual bool BuildPackage(const String& package, Vector<String>& linkfile, String& linkoptions,
|
||||
const Vector<String>& all_uses, const Vector<String>& all_libraries, int optimize)
|
||||
|
|
@ -399,7 +400,7 @@ struct Builder {
|
|||
const Index<String>& common_config, bool exporting) {}
|
||||
virtual String GetTargetExt() const = 0;
|
||||
|
||||
Builder() { doall = false; }
|
||||
Builder() { doall = false; main_conf = false; }
|
||||
virtual ~Builder() {}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue