@@ -636,7 +636,7 @@ bool runcpp2::GatherDependenciesBinaries( const std::vector<Data::DependencyIn
636636 if (it.is_directory ())
637637 continue ;
638638
639- std::string currentFileName = it.path ().stem ().string ();
639+ std::string currentFileName = it.path ().filename ().string ();
640640 std::string currentExtension = runcpp2::GetFileExtensionWithoutVersion (it.path ());
641641
642642 ssLOG_DEBUG (" currentFileName: " << currentFileName);
@@ -663,7 +663,6 @@ bool runcpp2::GatherDependenciesBinaries( const std::vector<Data::DependencyIn
663663 continue ;
664664
665665 bool extensionMatched = false ;
666-
667666 for (int j = 0 ; j < extensionsToLink.size (); ++j)
668667 {
669668 if (currentExtension == extensionsToLink.at (j))
@@ -677,23 +676,26 @@ bool runcpp2::GatherDependenciesBinaries( const std::vector<Data::DependencyIn
677676 continue ;
678677
679678 // Handle symlink
680- ghc::filesystem::path finalPath = it.path ();
679+ ghc::filesystem::path resolvedPath = it.path ();
681680 {
682681 std::error_code symlink_ec;
683- finalPath = ResolveSymlink (finalPath , symlink_ec);
682+ resolvedPath = ResolveSymlink (resolvedPath , symlink_ec);
684683 if (symlink_ec)
685684 {
686685 ssLOG_ERROR (" Failed to resolve symlink: " << symlink_ec.message ());
687686 return false ;
688687 }
689688 }
690689
691- const std::string processedFinalPath = runcpp2::ProcessPath (finalPath.string ());
692- if (binariesPathsSet.count (processedFinalPath) == 0 )
690+ const std::string processedPath = runcpp2::ProcessPath (it.path ().string ());
691+ const std::string processedResolvedPath =
692+ runcpp2::ProcessPath (resolvedPath.string ());
693+
694+ if (binariesPathsSet.count (processedResolvedPath) == 0 )
693695 {
694- ssLOG_INFO (" Linking " << finalPath. string () );
695- outBinariesPaths.push_back (processedFinalPath );
696- binariesPathsSet.insert (processedFinalPath );
696+ ssLOG_INFO (" Linking " << processedPath );
697+ outBinariesPaths.push_back (processedPath );
698+ binariesPathsSet.insert (processedResolvedPath );
697699 }
698700 }
699701 }
0 commit comments