Skip to content
Snippets Groups Projects
Commit 0ab817fa authored by Sebastian Holtermann's avatar Sebastian Holtermann Committed by Brad King
Browse files

Autogen: Optimize GetCompileDefinitionsAndDirectories function

parent 754d4318
No related branches found
No related tags found
No related merge requests found
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment