From 39234061dd1c6bf1eb3f2688ce03eb6f8b3f3fa0 Mon Sep 17 00:00:00 2001 From: Woongsuk Cho Date: Wed, 3 Jul 2019 12:59:23 +0900 Subject: [PATCH] bug-fix : support TAC and NI_SUB_DIR for nitool --pkg-dll option --- NativeLauncher/tool/ni_common.cc | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/NativeLauncher/tool/ni_common.cc b/NativeLauncher/tool/ni_common.cc index 1743c79..666f752 100644 --- a/NativeLauncher/tool/ni_common.cc +++ b/NativeLauncher/tool/ni_common.cc @@ -108,15 +108,20 @@ static std::string getNiFilePath(const std::string& dllPath) static std::string getAppNIPath(const std::string& niPath) { + std::string fileName; + std::string niDirPath; + std::string prevPath; + size_t index = niPath.find_last_of("/"); - if (index == std::string::npos) { - fprintf(stderr, "dllPath doesnot contains path info\n"); - return ""; + if (index != std::string::npos) { + prevPath = niPath.substr(0, index); + fileName = niPath.substr(index + 1, niPath.length()); + } else { + prevPath = "."; + fileName = niPath; } - std::string prevPath = niPath.substr(0, index); - std::string fileName = niPath.substr(index, niPath.length()); - std::string niDirPath = concatPath(prevPath, APP_NI_SUB_DIR); + niDirPath = concatPath(prevPath, APP_NI_SUB_DIR); if (!isFileExist(niDirPath)) { if (mkdir(niDirPath.c_str(), 0755) == 0) { @@ -126,7 +131,7 @@ static std::string getAppNIPath(const std::string& niPath) } } - return niDirPath + fileName; + return concatPath(niDirPath, fileName); } static bool niExist(const std::string& path) @@ -394,7 +399,8 @@ ni_error_e createNiDllUnderPkgRoot(const std::string& pkgId, const std::string& std::string binDir = concatPath(pkgRoot, "bin"); std::string libDir = concatPath(pkgRoot, "lib"); - std::string paths = binDir + ":" + libDir; + std::string appTAC = concatPath(binDir, ".TAC.Release"); + std::string paths = binDir + ":" + libDir + ":" + appTAC; return crossgen(dllPath, paths, enableR2R, true); } -- 2.7.4