diff options
author | Brad King <brad.king@kitware.com> | 2022-04-11 15:06:28 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-04-11 17:40:13 (GMT) |
commit | 8c65b7042e0e7bca3dc5c0cda8975fd2e9c6dc51 (patch) | |
tree | 340fba27fb9bd49f82197ba477939a2ee9bfcd2e /Source/cmExportFileGenerator.h | |
parent | 7fc248bde34c529c6f1312a56c7e82303238b9c1 (diff) | |
download | CMake-8c65b7042e0e7bca3dc5c0cda8975fd2e9c6dc51.zip CMake-8c65b7042e0e7bca3dc5c0cda8975fd2e9c6dc51.tar.gz CMake-8c65b7042e0e7bca3dc5c0cda8975fd2e9c6dc51.tar.bz2 |
cmExportFileGenerator: Simplify collection of targets missing from export set
Store the list of missing target names in a member instead of threading
an explicit reference to it through the call stack.
Diffstat (limited to 'Source/cmExportFileGenerator.h')
-rw-r--r-- | Source/cmExportFileGenerator.h | 49 |
1 files changed, 20 insertions, 29 deletions
diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h index bde6f1b..d27a555 100644 --- a/Source/cmExportFileGenerator.h +++ b/Source/cmExportFileGenerator.h @@ -66,8 +66,7 @@ protected: // Generate per-configuration target information to the given output // stream. - void GenerateImportConfig(std::ostream& os, const std::string& config, - std::vector<std::string>& missingTargets); + void GenerateImportConfig(std::ostream& os, const std::string& config); // Methods to implement export file code generation. virtual void GeneratePolicyHeaderCode(std::ostream& os); @@ -88,8 +87,7 @@ protected: ImportPropertyMap const& properties, const std::set<std::string>& importedLocations); virtual void GenerateImportedFileCheckLoop(std::ostream& os); - virtual void GenerateMissingTargetsCheckCode( - std::ostream& os, const std::vector<std::string>& missingTargets); + virtual void GenerateMissingTargetsCheckCode(std::ostream& os); virtual void GenerateExpectedTargetsCode(std::ostream& os, const std::string& expectedTargets); @@ -99,8 +97,7 @@ protected: void SetImportDetailProperties(const std::string& config, std::string const& suffix, cmGeneratorTarget* target, - ImportPropertyMap& properties, - std::vector<std::string>& missingTargets); + ImportPropertyMap& properties); enum class ImportLinkPropertyTargetNames { @@ -113,31 +110,28 @@ protected: const std::string& propName, std::vector<T> const& entries, ImportPropertyMap& properties, - std::vector<std::string>& missingTargets, ImportLinkPropertyTargetNames targetNames); /** Each subclass knows how to generate its kind of export file. */ virtual bool GenerateMainFile(std::ostream& os) = 0; /** Each subclass knows where the target files are located. */ - virtual void GenerateImportTargetsConfig( - std::ostream& os, const std::string& config, std::string const& suffix, - std::vector<std::string>& missingTargets) = 0; + virtual void GenerateImportTargetsConfig(std::ostream& os, + const std::string& config, + std::string const& suffix) = 0; /** Each subclass knows how to deal with a target that is missing from an * export set. */ virtual void HandleMissingTarget(std::string& link_libs, - std::vector<std::string>& missingTargets, cmGeneratorTarget const* depender, cmGeneratorTarget* dependee) = 0; void PopulateInterfaceProperty(const std::string&, cmGeneratorTarget const* target, cmGeneratorExpression::PreprocessContext, - ImportPropertyMap& properties, - std::vector<std::string>& missingTargets); + ImportPropertyMap& properties); bool PopulateInterfaceLinkLibrariesProperty( cmGeneratorTarget const* target, cmGeneratorExpression::PreprocessContext, - ImportPropertyMap& properties, std::vector<std::string>& missingTargets); + ImportPropertyMap& properties); void PopulateInterfaceProperty(const std::string& propName, cmGeneratorTarget const* target, ImportPropertyMap& properties); @@ -149,26 +143,24 @@ protected: void PopulateIncludeDirectoriesInterface( cmGeneratorTarget const* target, cmGeneratorExpression::PreprocessContext preprocessRule, - ImportPropertyMap& properties, std::vector<std::string>& missingTargets, - cmTargetExport const& te); + ImportPropertyMap& properties, cmTargetExport const& te); void PopulateSourcesInterface( cmGeneratorTarget const* target, cmGeneratorExpression::PreprocessContext preprocessRule, - ImportPropertyMap& properties, std::vector<std::string>& missingTargets); + ImportPropertyMap& properties); void PopulateLinkDirectoriesInterface( cmGeneratorTarget const* target, cmGeneratorExpression::PreprocessContext preprocessRule, - ImportPropertyMap& properties, std::vector<std::string>& missingTargets); + ImportPropertyMap& properties); void PopulateLinkDependsInterface( cmGeneratorTarget const* target, cmGeneratorExpression::PreprocessContext preprocessRule, - ImportPropertyMap& properties, std::vector<std::string>& missingTargets); + ImportPropertyMap& properties); void SetImportLinkInterface( const std::string& config, std::string const& suffix, cmGeneratorExpression::PreprocessContext preprocessRule, - cmGeneratorTarget const* target, ImportPropertyMap& properties, - std::vector<std::string>& missingTargets); + cmGeneratorTarget const* target, ImportPropertyMap& properties); enum FreeTargetsReplace { @@ -178,7 +170,6 @@ protected: void ResolveTargetsInGeneratorExpressions( std::string& input, cmGeneratorTarget const* target, - std::vector<std::string>& missingTargets, FreeTargetsReplace replace = NoReplaceFreeTargets); virtual void GenerateRequiredCMakeVersion(std::ostream& os, @@ -216,20 +207,20 @@ protected: // The set of targets included in the export. std::set<cmGeneratorTarget*> ExportedTargets; + std::vector<std::string> MissingTargets; + private: void PopulateInterfaceProperty(const std::string&, const std::string&, cmGeneratorTarget const* target, cmGeneratorExpression::PreprocessContext, - ImportPropertyMap& properties, - std::vector<std::string>& missingTargets); + ImportPropertyMap& properties); bool AddTargetNamespace(std::string& input, cmGeneratorTarget const* target, - cmLocalGenerator const* lg, - std::vector<std::string>& missingTargets); + cmLocalGenerator const* lg); - void ResolveTargetsInGeneratorExpression( - std::string& input, cmGeneratorTarget const* target, - cmLocalGenerator const* lg, std::vector<std::string>& missingTargets); + void ResolveTargetsInGeneratorExpression(std::string& input, + cmGeneratorTarget const* target, + cmLocalGenerator const* lg); virtual void ReplaceInstallPrefix(std::string& input); |