From: j-h.choi Date: Tue, 27 May 2025 02:57:51 +0000 (+0900) Subject: Modify to find high priority RID values according to folder name order X-Git-Tag: accepted/tizen/unified/20250604.100251~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1b240d809abe8689ac73f2f6fe6d395255e5a029;p=platform%2Fcore%2Fdotnet%2Flauncher.git Modify to find high priority RID values according to folder name order Change-Id: Ib9b7d61b6039d6668099b726f12c13578a61fd05 --- diff --git a/NativeLauncher/tool/multi_target_resolver.cc b/NativeLauncher/tool/multi_target_resolver.cc index af9527f..13800fd 100644 --- a/NativeLauncher/tool/multi_target_resolver.cc +++ b/NativeLauncher/tool/multi_target_resolver.cc @@ -152,14 +152,18 @@ int resolvePlatformSpecificFiles(const std::string& rootPath) // found best matched rid and tfm directory and copy all files to bin directory std::vector ridFallbackGraph = getRidFallbackGraph(); + int bestMatch = ridFallbackGraph.size(); try { for (auto& rid : bf::recursive_directory_iterator(runtimesPath)) { std::string ridPath = rid.path().string(); + int ridCnt = 0; if (bf::is_directory(ridPath) && strstr(ridPath.c_str(), ARCHITECTURE_IDENTIFIER) != NULL) { for (auto& ridFG : ridFallbackGraph) { + ridCnt++; if (!strcmp(getFileName(ridPath).c_str(), ridFG.c_str())) { std::string nativePath = concatPath(ridPath, "native"); - if (isDirectory(nativePath)) { + if (isDirectory(nativePath) && bestMatch >= ridCnt) { + bestMatch = ridCnt; _INFO("Found best matched rid (%s)", ridFG.c_str()); // copy all files from bin/runtimes/${rid}/native to appBintPath if exist if (!moveAllFilesTo(nativePath, appBinPath)) { @@ -173,7 +177,8 @@ int resolvePlatformSpecificFiles(const std::string& rootPath) std::vector tfmFallbackGraph = getTfmFallbackGraph(); for (auto& tfmFG : tfmFallbackGraph) { std::string tfmPath = concatPath(libPath, tfmFG); - if (isDirectory(tfmPath)) { + if (isDirectory(tfmPath) && bestMatch >= ridCnt) { + bestMatch = ridCnt; _INFO("Found best matched tfm (%s)", tfmFG .c_str()); // copy all files from bin/runtimes/${rid}/lib/${tfm} to appBintPath if exist if (!moveAllFilesTo(tfmPath, appBinPath)) {