aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-10-14 04:58:11 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-06 07:39:33 +0200
commitd00a3a0371bcbe008525dff0456bb88b6977dd82 (patch)
treecf316e724f4dbeaeb7efd9e4a0728da673168312
parent5e79e361c97e88b4a5912990eda0f1fb0d4a6dbd (diff)
Define win macro on mingw
-rw-r--r--backend/ninja/Ninja.cpp30
1 files changed, 24 insertions, 6 deletions
diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp
index f236210..3e69ef1 100644
--- a/backend/ninja/Ninja.cpp
+++ b/backend/ninja/Ninja.cpp
@@ -127,11 +127,17 @@ namespace backend
case Compiler::MINGW_W64:
case Compiler::GCC:
{
- return "'-D" + name + "=" + value + "'";
+ if(value.empty())
+ return "'-D" + name + "=" + value + "'";
+ else
+ return "'-D" + name + "'";
}
case Compiler::MSVC:
{
- return "\"/D" + name + "=" + value + "\"";
+ if(value.empty())
+ return "\"/D" + name + "=" + value + "\"";
+ else
+ return "\"/D" + name + "\"";
}
default:
assert(false);
@@ -919,13 +925,25 @@ namespace backend
defines.push_back(ninja::NinjaArg::createRaw(getDefineFlag(config.getCompiler(), definePair.first, definePair.second)));
}
- switch (SYSTEM_PLATFORM)
+ switch (config.platform)
{
case PLATFORM_WIN64:
- defines.insert(defines.end(), { ninja::NinjaArg("/DWIN64"), ninja::NinjaArg("/D_WIN64") });
- // fallthrough
+ {
+ for(const string &define : { "WIN64", "_WIN64", "WIN32", "_WIN32" })
+ {
+ defines.push_back(ninja::NinjaArg::createRaw(getDefineFlag(config.getCompiler(), define, "")));
+ }
+ break;
+ }
case PLATFORM_WIN32:
- defines.insert(defines.end(), { ninja::NinjaArg("/DWIN32"), ninja::NinjaArg("/D_WIN32") });
+ {
+ for(const string &define : { "WIN32", "_WIN32" })
+ {
+ defines.push_back(ninja::NinjaArg::createRaw(getDefineFlag(config.getCompiler(), define, "")));
+ }
+ break;
+ }
+ default:
break;
}