File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -243,6 +243,16 @@ namespace
243243 substitutionMap[" {OutputFileDirectory}" ] =
244244 {runcpp2::ProcessPath ( (buildDir / relativeSourcePath.parent_path ()).string () )};
245245
246+ if (!runcpp2::HasValueFromPlatformMap (profile.FilesTypes .ObjectLinkFile .Extension ))
247+ {
248+ ssLOG_ERROR (" profile " << profile.Name << " missing extension for " <<
249+ " object link file" );
250+ return false ;
251+ }
252+
253+ std::string objectExt =
254+ *runcpp2::GetValueFromPlatformMap (profile.FilesTypes .ObjectLinkFile .Extension );
255+
246256 for (int j = 0 ; j < currentOutputTypeInfo->ExpectedOutputFiles .size (); ++j)
247257 {
248258 std::string currentPath = currentOutputTypeInfo->ExpectedOutputFiles .at (j);
@@ -252,7 +262,6 @@ namespace
252262 return false ;
253263 }
254264
255- outObjectsFilesPaths.push_back (currentPath);
256265 auto path = ghc::filesystem::path (currentPath);
257266 ghc::filesystem::create_directories (path.parent_path (), e);
258267 if (e)
@@ -261,6 +270,15 @@ namespace
261270 ssLOG_ERROR (" Failed with error: " << e.message ());
262271 return false ;
263272 }
273+
274+ if (path.extension () != objectExt)
275+ {
276+ ssLOG_DEBUG (" Skipping " << currentPath << " for being added for linking" );
277+ continue ;
278+ }
279+
280+ outObjectsFilesPaths.push_back (currentPath);
281+ // TODO: Check if the current path exists after performing the compilation
264282 }
265283 }
266284
Original file line number Diff line number Diff line change @@ -237,6 +237,7 @@ namespace
237237 ssLOG_INFO (outputPath.string () << " doesn't exist" );
238238 }
239239
240+ // TODO: Parsing ExpectedOutputFiles in the profile to see cache is valid or not
240241 // NOTE: We don't know which ones are optionals, at least for now.
241242 // If there's nothing, there's no cache for sure.
242243 // If there's something, it's very likely we have it cached.
You can’t perform that action at this time.
0 commit comments