diff options
-rw-r--r-- | Source/cmQtAutoGenInitializer.cxx | 6 | ||||
-rw-r--r-- | Source/cmQtAutoGeneratorMocUic.cxx | 10 |
2 files changed, 6 insertions, 10 deletions
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 582faf6..86d7947 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -521,6 +521,12 @@ bool cmQtAutoGenInitializer::InitMoc() [this, localGen](std::string const& cfg) -> std::set<std::string> { std::set<std::string> defines; localGen->GetTargetDefines(this->Target, cfg, "CXX", defines); +#ifdef _WIN32 + if (this->Moc.PredefsCmd.empty()) { + // Add WIN32 definition if we don't have a moc_predefs.h + defines.insert("WIN32"); + } +#endif return defines; }; diff --git a/Source/cmQtAutoGeneratorMocUic.cxx b/Source/cmQtAutoGeneratorMocUic.cxx index 2e6f90f..446ef9a 100644 --- a/Source/cmQtAutoGeneratorMocUic.cxx +++ b/Source/cmQtAutoGeneratorMocUic.cxx @@ -1279,16 +1279,6 @@ bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile) Moc_.SkipList.insert(lst.begin(), lst.end()); } Moc_.Definitions = InfoGetConfigList("AM_MOC_DEFINITIONS"); -#ifdef _WIN32 - { - std::string win32("WIN32"); - auto itB = Moc().Definitions.cbegin(); - auto itE = Moc().Definitions.cend(); - if (std::find(itB, itE, win32) == itE) { - Moc_.Definitions.emplace_back(std::move(win32)); - } - } -#endif Moc_.IncludePaths = InfoGetConfigList("AM_MOC_INCLUDES"); Moc_.Options = InfoGetList("AM_MOC_OPTIONS"); Moc_.RelaxedMode = InfoGetBool("AM_MOC_RELAXED_MODE"); |