mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-04 12:49:36 -06:00
Autogen: Optimize GetCompileDefinitionsAndDirectories function
This commit is contained in:
committed by
Brad King
parent
754d431813
commit
0ab817fa1e
@@ -98,6 +98,26 @@ static std::string GetQtMajorVersion(cmGeneratorTarget const* target)
|
|||||||
return qtMajorVersion;
|
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,
|
static void SetupSourceFiles(cmGeneratorTarget const* target,
|
||||||
std::vector<std::string>& mocUicSources,
|
std::vector<std::string>& mocUicSources,
|
||||||
std::vector<std::string>& mocUicHeaders,
|
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(
|
static void MocSetupAutoTarget(
|
||||||
cmGeneratorTarget const* target, const std::string& autogenTargetName,
|
cmGeneratorTarget const* target, const std::string& autogenTargetName,
|
||||||
std::vector<std::string> const& skipMoc,
|
std::vector<std::string> const& skipMoc,
|
||||||
|
|||||||
Reference in New Issue
Block a user