diff options
Diffstat (limited to 'backend/ninja')
-rw-r--r-- | backend/ninja/Ninja.cpp | 30 |
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; } |