diff options
author | Cho Woong Suk <ws77.cho@samsung.com> | 2018-02-02 11:57:16 +0900 |
---|---|---|
committer | Cho Woong Suk <ws77.cho@samsung.com> | 2018-02-02 11:57:16 +0900 |
commit | 39ed7656c266b754e71eb430c02ad60a980d869d (patch) | |
tree | f32b3bf075e3bdc01f3773b74210677383dc5de3 | |
parent | 43a03fd7fb4fb983f493fc42599a55950ced466c (diff) | |
download | launcher-tizen_4.0_tv.tar.gz launcher-tizen_4.0_tv.tar.bz2 launcher-tizen_4.0_tv.zip |
support multi-architecture library for lib dirsubmit/tizen_4.0/20180202.030215accepted/tizen/4.0/unified/20180205.144559tizen_4.0_tv
Change-Id: Id603602bf46d477f3aa57813ad2f7c19e07aad9c
-rw-r--r-- | NativeLauncher/launcher/dotnet/dotnet_launcher.cc | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/NativeLauncher/launcher/dotnet/dotnet_launcher.cc b/NativeLauncher/launcher/dotnet/dotnet_launcher.cc index 265c925..af29793 100644 --- a/NativeLauncher/launcher/dotnet/dotnet_launcher.cc +++ b/NativeLauncher/launcher/dotnet/dotnet_launcher.cc @@ -38,6 +38,29 @@ namespace tizen { namespace runtime { namespace dotnetcore { +#if defined (__aarch64__) +#define ARCHITECTURE_IDENTIFIER "arm64" +#elif defined (__arm__) +#define ARCHITECTURE_IDENTIFIER "arm" +#elif defined (__x86_64__) +#define ARCHITECTURE_IDENTIFIER "x64" +#elif defined (__i386__) +#define ARCHITECTURE_IDENTIFIER "x86" +#else +#define ARCHITECTURE_IDENTIFIER "unknown" +#endif + +static std::string getExtraNativeLibDirs(const std::string& appRoot) +{ + // auto generated directory by nuget will be considered later + std::string candidate = concatPath(appRoot, "lib/" ARCHITECTURE_IDENTIFIER); + if (!strncmp(ARCHITECTURE_IDENTIFIER, "arm64", 5)) { + candidate = candidate + ":" + concatPath(appRoot, "lib/aarch64"); + } + + return candidate; +} + CoreRuntime::CoreRuntime() : initializeClr(nullptr), executeAssembly(nullptr), @@ -188,7 +211,7 @@ int CoreRuntime::initialize(bool standalone) assembliesInDirectory(searchDirectories, tpa); std::string nativeLibPath; - nativeLibPath = appLib + ":" + appBin + ":" + __nativeLibDirectory; + nativeLibPath = getExtraNativeLibDirs(appRoot) + ":" + appLib + ":" + appBin + ":" + __nativeLibDirectory; std::string appName = std::string("dotnet-launcher-") + std::to_string(getpid()); if (!initializeCoreClr(appName.c_str(), probePath.c_str(), nativeLibPath.c_str(), tpa.c_str())) { |