summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalUnixMakefileGenerator3.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-07-28 15:01:30 (GMT)
committerBrad King <brad.king@kitware.com>2020-08-03 14:04:22 (GMT)
commite7edba2bafc7eb187a05c20acf4e859e500c7c5b (patch)
tree515619e73e2f698ff6c8f7885dd96e81dc6dc8a0 /Source/cmGlobalUnixMakefileGenerator3.cxx
parentbda967bcb9ff48191b7aa6f818f6bf3fe9940d6f (diff)
downloadCMake-e7edba2bafc7eb187a05c20acf4e859e500c7c5b.zip
CMake-e7edba2bafc7eb187a05c20acf4e859e500c7c5b.tar.gz
CMake-e7edba2bafc7eb187a05c20acf4e859e500c7c5b.tar.bz2
Makefiles: Use IsInBuildSystem in global generator target type checks
Follow up from commit 422d9a0ab2 (Factor out generator checks for filtering out interface libraries, 2020-07-20) with more uses of `IsInBuildSystem`.
Diffstat (limited to 'Source/cmGlobalUnixMakefileGenerator3.cxx')
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx30
1 files changed, 9 insertions, 21 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index ebc90b6..37a77fa 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -387,12 +387,8 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefileLanguageRules(
cm::static_reference_cast<cmLocalUnixMakefileGenerator3>(lGenerator);
// for all of out targets
for (const auto& tgt : lg.GetGeneratorTargets()) {
- if ((tgt->GetType() == cmStateEnums::EXECUTABLE) ||
- (tgt->GetType() == cmStateEnums::STATIC_LIBRARY) ||
- (tgt->GetType() == cmStateEnums::SHARED_LIBRARY) ||
- (tgt->GetType() == cmStateEnums::MODULE_LIBRARY) ||
- (tgt->GetType() == cmStateEnums::OBJECT_LIBRARY) ||
- (tgt->GetType() == cmStateEnums::UTILITY)) {
+ if (tgt->IsInBuildSystem() &&
+ tgt->GetType() != cmStateEnums::GLOBAL_TARGET) {
std::string tname = cmStrCat(lg.GetRelativeTargetDirectory(tgt.get()),
"/DependInfo.cmake");
cmSystemTools::ConvertToUnixSlashes(tname);
@@ -635,17 +631,12 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules(
for (const auto& gtarget : lg.GetGeneratorTargets()) {
// Don't emit the same rule twice (e.g. two targets with the same
// simple name)
- int type = gtarget->GetType();
std::string name = gtarget->GetName();
if (!name.empty() && emitted.insert(name).second &&
// Handle user targets here. Global targets are handled in
// the local generator on a per-directory basis.
- ((type == cmStateEnums::EXECUTABLE) ||
- (type == cmStateEnums::STATIC_LIBRARY) ||
- (type == cmStateEnums::SHARED_LIBRARY) ||
- (type == cmStateEnums::MODULE_LIBRARY) ||
- (type == cmStateEnums::OBJECT_LIBRARY) ||
- (type == cmStateEnums::UTILITY))) {
+ (gtarget->IsInBuildSystem() &&
+ gtarget->GetType() != cmStateEnums::GLOBAL_TARGET)) {
// Add a rule to build the target by name.
lg.WriteDivider(ruleFileStream);
ruleFileStream << "# Target rules for targets named " << name
@@ -709,15 +700,10 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2(
// for each target Generate the rule files for each target.
for (const auto& gtarget : lg.GetGeneratorTargets()) {
- int type = gtarget->GetType();
std::string name = gtarget->GetName();
if (!name.empty() &&
- ((type == cmStateEnums::EXECUTABLE) ||
- (type == cmStateEnums::STATIC_LIBRARY) ||
- (type == cmStateEnums::SHARED_LIBRARY) ||
- (type == cmStateEnums::MODULE_LIBRARY) ||
- (type == cmStateEnums::OBJECT_LIBRARY) ||
- (type == cmStateEnums::UTILITY))) {
+ (gtarget->IsInBuildSystem() &&
+ gtarget->GetType() != cmStateEnums::GLOBAL_TARGET)) {
std::string makefileName;
// Add a rule to build the target by name.
localName = lg.GetRelativeTargetDirectory(gtarget.get());
@@ -985,7 +971,9 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule(
(type == cmStateEnums::STATIC_LIBRARY) ||
(type == cmStateEnums::SHARED_LIBRARY) ||
(type == cmStateEnums::MODULE_LIBRARY) ||
- (type == cmStateEnums::OBJECT_LIBRARY)) {
+ (type == cmStateEnums::OBJECT_LIBRARY) ||
+ (type == cmStateEnums::INTERFACE_LIBRARY &&
+ target->IsInBuildSystem())) {
project_targets.insert(target->GetName());
} else if (type == cmStateEnums::GLOBAL_TARGET) {
globals_targets.insert(target->GetName());