From 20e4db4a6671ef2c39863d08fc5513848c1a07b6 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 20 Oct 2020 16:38:09 -0400 Subject: cmGeneratorTarget: Make GetConfigCommonSourceFiles Xcode-specific The Xcode generator is the only place left that we do not support per-config sources. Make the corresponding helper Xcode-specific to avoid any other new uses. --- Source/cmGeneratorTarget.cxx | 2 +- Source/cmGeneratorTarget.h | 5 +++-- Source/cmGlobalXCodeGenerator.cxx | 8 ++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index dfeb029..e2943d6 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -7039,7 +7039,7 @@ const cmLinkImplementation* cmGeneratorTarget::GetLinkImplementation( return &impl; } -bool cmGeneratorTarget::GetConfigCommonSourceFiles( +bool cmGeneratorTarget::GetConfigCommonSourceFilesForXcode( std::vector& files) const { std::vector const& configs = diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index cb312ad..51369c2 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -430,8 +430,9 @@ public: /** Get source files common to all configurations and diagnose cases with per-config sources. Excludes sources added by a TARGET_OBJECTS - generator expression. */ - bool GetConfigCommonSourceFiles(std::vector& files) const; + generator expression. Do not use outside the Xcode generator. */ + bool GetConfigCommonSourceFilesForXcode( + std::vector& files) const; bool HaveBuildTreeRPATH(const std::string& config) const; diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 70aa052..b6fedaf 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1384,7 +1384,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeTarget( // organize the sources std::vector commonSourceFiles; - if (!gtgt->GetConfigCommonSourceFiles(commonSourceFiles)) { + if (!gtgt->GetConfigCommonSourceFilesForXcode(commonSourceFiles)) { return false; } @@ -1748,7 +1748,7 @@ void cmGlobalXCodeGenerator::CreateCustomCommands( this->CreateRunScriptBuildPhase("CMake PostBuild Rules", postbuild); } else { std::vector classes; - if (!gtgt->GetConfigCommonSourceFiles(classes)) { + if (!gtgt->GetConfigCommonSourceFilesForXcode(classes)) { return; } // add all the sources @@ -1821,7 +1821,7 @@ void cmGlobalXCodeGenerator::CreateRunScriptBuildPhases( cmXCodeObject* buildPhases, cmGeneratorTarget const* gt) { std::vector sources; - if (!gt->GetConfigCommonSourceFiles(sources)) { + if (!gt->GetConfigCommonSourceFilesForXcode(sources)) { return; } auto& visited = this->CommandsVisited[gt]; @@ -2964,7 +2964,7 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateUtilityTarget( if (gtgt->GetType() != cmStateEnums::GLOBAL_TARGET && gtgt->GetName() != CMAKE_CHECK_BUILD_SYSTEM_TARGET) { std::vector sources; - if (!gtgt->GetConfigCommonSourceFiles(sources)) { + if (!gtgt->GetConfigCommonSourceFilesForXcode(sources)) { return nullptr; } -- cgit v0.12