AndroidBuilder now doesn't undefine platform flags.

git-svn-id: svn://ultimatepp.org/upp/trunk@10789 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
klugier 2017-01-28 18:13:01 +00:00
parent dda6a2eab5
commit 217198331b
5 changed files with 24 additions and 24 deletions

View file

@ -313,21 +313,6 @@ bool AndroidBuilder::Preprocess(
void AndroidBuilder::AddFlags(Index<String>& cfg)
{
// TODO: Blood hack - should be remove after release.
// Talk with Mirek how to do it well - without over engineering.
// U++ is not ready for full cross compilation right now.
cfg.RemoveKey("WIN32");
cfg.RemoveKey("LINUX");
cfg.RemoveKey("POSIX");
cfg.RemoveKey("BSD");
cfg.RemoveKey("FREEBSD");
cfg.RemoveKey("OPENBSD");
cfg.RemoveKey("NETBSD");
cfg.RemoveKey("DRAGONFLY");
cfg.RemoveKey("SOLARIS");
cfg.RemoveKey("OSX11");
cfg.Add("LINUX");
cfg.Add("POSIX");
cfg.Add("ANDROID");

View file

@ -54,8 +54,8 @@ Index<String> MakeBuild::PackageConfig(const Workspace& wspc, int package,
if(!pkg.noblitz && m.def.blitz && bm.Get("DISABLE_BLITZ", "") != "1")
cfg.FindAdd("BLITZ");
}
host.AddFlags(cfg);
b.AddFlags(cfg);
host.AddFlags(cfg);
for(int i = 0; i < pkg.flag.GetCount(); i++) {
if(MatchWhen(pkg.flag[i].when, cfg.GetKeys())) {
Vector<String> h = Split(pkg.flag[i].text, ' ');

View file

@ -315,12 +315,9 @@ void LocalHost::Launch(const char *_cmdline, bool console)
void LocalHost::AddFlags(Index<String>& cfg)
{
// Allow to specify custom platform flags
for (const String& config : cfg)
if(findarg(config, "WIN32", "LINUX", "POSIX", "BSD", "FREEBSD",
"OPENBSD", "NETBSD", "DRAGONFLY", "SOLARIS", "OSX11") >= 0)
return;
if(HasPlatformFlag(cfg))
return;
#if defined(PLATFORM_WIN32)
cfg.Add("WIN32");
#endif
@ -362,6 +359,21 @@ void LocalHost::AddFlags(Index<String>& cfg)
#endif
}
bool LocalHost::HasPlatformFlag(const Index<String>& cfg)
{
static const Index<String> platformFlags = {
"ANDROID", "WIN32", "LINUX", "POSIX",
"BSD", "FREEBSD", "OPENBSD", "NETBSD",
"DRAGONFLY", "SOLARIS", "OSX11"
};
for(const String& flag : cfg)
if(platformFlags.Find(flag) >= 0)
return true;
return false;
}
#if 0
static bool IsSamePath(const char *a, const char *b, int count) {
for(; --count >= 0; a++, b++)

View file

@ -33,7 +33,8 @@ struct Host {
virtual ~Host() {}
};
struct LocalHost : Host {
class LocalHost : public Host {
public:
Vector<String> exedirs;
String environment;
@ -63,6 +64,9 @@ struct LocalHost : Host {
virtual One<AProcess> StartProcess(const char *cmdline);
virtual void Launch(const char *cmdline, bool console);
virtual void AddFlags(Index<String>& cfg);
private:
bool HasPlatformFlag(const Index<String>& cfg);
};
/*

View file

@ -891,7 +891,6 @@ String Ide::GetIncludePath()
MergeWith(include, ";", ndk.GetIncludeDir());
String cppIncludeDir = ndk.GetCppIncludeDir(bm.Get("NDK_CPP_RUNTIME", ""));
Cout() << cppIncludeDir << "\n";
if(!cppIncludeDir.IsEmpty())
MergeWith(include, ";", cppIncludeDir);
}