diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2017-02-19 12:17:42 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-02-21 15:38:50 (GMT) |
commit | 0ab817fa1e1c9bae8aa63c331d4483d9d9b190c5 (patch) | |
tree | 0d105b79c3a4bdaa63d53dcf1cfc7bab24743646 /Source/cmQtAutoGeneratorInitializer.cxx | |
parent | 754d431813fb4726ca2460641d826240387eb718 (diff) | |
download | CMake-0ab817fa1e1c9bae8aa63c331d4483d9d9b190c5.zip CMake-0ab817fa1e1c9bae8aa63c331d4483d9d9b190c5.tar.gz CMake-0ab817fa1e1c9bae8aa63c331d4483d9d9b190c5.tar.bz2 |
Autogen: Optimize GetCompileDefinitionsAndDirectories function
Diffstat (limited to 'Source/cmQtAutoGeneratorInitializer.cxx')
-rw-r--r-- | Source/cmQtAutoGeneratorInitializer.cxx | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index d17faf6..c201023 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -98,6 +98,26 @@ static std::string GetQtMajorVersion(cmGeneratorTarget const* target) return qtMajorVersion; } +static void GetCompileDefinitionsAndDirectories( + cmGeneratorTarget const* target, const std::string& config, + std::string& incs, std::string& defs) +{ + cmLocalGenerator* localGen = target->GetLocalGenerator(); + { + std::vector<std::string> includeDirs; + // Get the include dirs for this target, without stripping the implicit + // include dirs off, see + // https://gitlab.kitware.com/cmake/cmake/issues/13667 + localGen->GetIncludeDirectories(includeDirs, target, "CXX", config, false); + incs = cmJoin(includeDirs, ";"); + } + { + std::set<std::string> defines; + localGen->AddCompileDefinitions(defines, target, config, "CXX"); + defs += cmJoin(defines, ";"); + } +} + static void SetupSourceFiles(cmGeneratorTarget const* target, std::vector<std::string>& mocUicSources, std::vector<std::string>& mocUicHeaders, @@ -162,24 +182,6 @@ static void SetupSourceFiles(cmGeneratorTarget const* target, } } -static void GetCompileDefinitionsAndDirectories( - cmGeneratorTarget const* target, const std::string& config, - std::string& incs, std::string& defs) -{ - std::vector<std::string> includeDirs; - cmLocalGenerator* localGen = target->GetLocalGenerator(); - // Get the include dirs for this target, without stripping the implicit - // include dirs off, see https://gitlab.kitware.com/cmake/cmake/issues/13667 - localGen->GetIncludeDirectories(includeDirs, target, "CXX", config, false); - - incs = cmJoin(includeDirs, ";"); - - std::set<std::string> defines; - localGen->AddCompileDefinitions(defines, target, config, "CXX"); - - defs += cmJoin(defines, ";"); -} - static void MocSetupAutoTarget( cmGeneratorTarget const* target, const std::string& autogenTargetName, std::vector<std::string> const& skipMoc, |