@@ -167,62 +167,81 @@ bool runcpp2::Data::DependencyInfo::ParseYAML_Node(ryml::ConstNodeRef& node)
167167std::string runcpp2::Data::DependencyInfo::ToString (std::string indentation) const
168168{
169169 std::string out;
170- out += indentation + " - Name: " + Name + " \n " ;
170+ out += indentation + " Name: " + GetEscapedYAMLString ( Name) + " \n " ;
171171
172- out += indentation + " Platforms:\n " ;
172+ out += indentation + " Platforms:\n " ;
173173 for (auto it = Platforms.begin (); it != Platforms.end (); ++it)
174- out += indentation + " - " + *it + " \n " ;
174+ out += indentation + " - " + GetEscapedYAMLString ( *it) + " \n " ;
175175
176+ out += indentation + " Source:\n " ;
176177 out += Source.ToString (indentation + " " );
177178
178179 static_assert ((int )DependencyLibraryType::COUNT == 4 , " " );
179180
180181 if (LibraryType == DependencyLibraryType::STATIC)
181- out += indentation + " LibraryType: Static\n " ;
182+ out += indentation + " LibraryType: Static\n " ;
182183 else if (LibraryType == DependencyLibraryType::SHARED)
183- out += indentation + " LibraryType: Shared\n " ;
184+ out += indentation + " LibraryType: Shared\n " ;
184185 else if (LibraryType == DependencyLibraryType::OBJECT)
185- out += indentation + " LibraryType: Object\n " ;
186+ out += indentation + " LibraryType: Object\n " ;
186187 else if (LibraryType == DependencyLibraryType::HEADER)
187- out += indentation + " LibraryType: Header\n " ;
188+ out += indentation + " LibraryType: Header\n " ;
188189
189- out += indentation + " IncludePaths:\n " ;
190- for (auto it = IncludePaths.begin (); it != IncludePaths.end (); ++it)
191- out += indentation + " - " + *it + " \n " ;
190+ if (!IncludePaths.empty ())
191+ {
192+ out += indentation + " IncludePaths:\n " ;
193+ for (auto it = IncludePaths.begin (); it != IncludePaths.end (); ++it)
194+ out += indentation + " - " + GetEscapedYAMLString (*it) + " \n " ;
195+ }
192196
193- out += indentation + " LinkProperties:\n " ;
194- for (auto it = LinkProperties.begin (); it != LinkProperties.end (); ++it)
197+ if (!LinkProperties.empty ())
195198 {
196- out += indentation + " " + it->first + " :\n " ;
197- out += it->second .ToString (indentation + " " );
199+ out += indentation + " LinkProperties:\n " ;
200+ for (auto it = LinkProperties.begin (); it != LinkProperties.end (); ++it)
201+ {
202+ out += indentation + " " + it->first + " :\n " ;
203+ out += it->second .ToString (indentation + " " );
204+ }
198205 }
199206
200- out += indentation + " Setup:\n " ;
201- for (auto it = Setup.begin (); it != Setup.end (); ++it)
207+ if (!Setup.empty ())
202208 {
203- out += indentation + " " + it->first + " :\n " ;
204- out += it->second .ToString (indentation + " " );
209+ out += indentation + " Setup:\n " ;
210+ for (auto it = Setup.begin (); it != Setup.end (); ++it)
211+ {
212+ out += indentation + " " + it->first + " :\n " ;
213+ out += it->second .ToString (indentation + " " );
214+ }
205215 }
206216
207- out += indentation + " Cleanup:\n " ;
208- for (auto it = Cleanup.begin (); it != Cleanup.end (); ++it)
217+ if (!Cleanup.empty ())
209218 {
210- out += indentation + " " + it->first + " :\n " ;
211- out += it->second .ToString (indentation + " " );
219+ out += indentation + " Cleanup:\n " ;
220+ for (auto it = Cleanup.begin (); it != Cleanup.end (); ++it)
221+ {
222+ out += indentation + " " + it->first + " :\n " ;
223+ out += it->second .ToString (indentation + " " );
224+ }
212225 }
213226
214- out += indentation + " Build:\n " ;
215- for (auto it = Build.begin (); it != Build.end (); ++it)
227+ if (!Build.empty ())
216228 {
217- out += indentation + " " + it->first + " :\n " ;
218- out += it->second .ToString (indentation + " " );
229+ out += indentation + " Build:\n " ;
230+ for (auto it = Build.begin (); it != Build.end (); ++it)
231+ {
232+ out += indentation + " " + it->first + " :\n " ;
233+ out += it->second .ToString (indentation + " " );
234+ }
219235 }
220236
221- out += indentation + " FilesToCopy:\n " ;
222- for (auto it = FilesToCopy.begin (); it != FilesToCopy.end (); ++it)
237+ if (!FilesToCopy.empty ())
223238 {
224- out += indentation + " " + it->first + " :\n " ;
225- out += it->second .ToString (indentation + " " );
239+ out += indentation + " FilesToCopy:\n " ;
240+ for (auto it = FilesToCopy.begin (); it != FilesToCopy.end (); ++it)
241+ {
242+ out += indentation + " " + it->first + " :\n " ;
243+ out += it->second .ToString (indentation + " " );
244+ }
226245 }
227246
228247 return out;
@@ -231,7 +250,7 @@ std::string runcpp2::Data::DependencyInfo::ToString(std::string indentation) con
231250bool runcpp2::Data::DependencyInfo::Equals (const DependencyInfo& other) const
232251{
233252 if ( Name != other.Name ||
234- Platforms != other.Platforms ||
253+ Platforms. size () != other.Platforms . size () ||
235254 !Source.Equals (other.Source ) ||
236255 LibraryType != other.LibraryType ||
237256 IncludePaths != other.IncludePaths ||
@@ -245,6 +264,12 @@ bool runcpp2::Data::DependencyInfo::Equals(const DependencyInfo& other) const
245264 return false ;
246265 }
247266
267+ for (const std::string& it : Platforms)
268+ {
269+ if (other.Platforms .count (it) == 0 )
270+ return false ;
271+ }
272+
248273 for (const auto & it : LinkProperties)
249274 {
250275 if ( other.LinkProperties .count (it.first ) == 0 ||
0 commit comments