Apply shared library extension name according to OS (#696)
author이성재/동작제어Lab(SR)/Principal Engineer/삼성전자 <sj925.lee@samsung.com>
Fri, 20 Jul 2018 07:49:01 +0000 (16:49 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Fri, 20 Jul 2018 07:49:01 +0000 (16:49 +0900)
* apply dll extension name according to OS in PR test.

Signed-off-by: Sung-Jae Lee <sj925.lee@samsung.com>
contrib/nnc/src/module/plugin/PluginManager.cpp

index 18184c8..66cfc34 100644 (file)
 #include "PluginException.h"
 #include "ConfigException.h"
 
+#ifdef __APPLE__
+#define STR_EXTENSION_PLUGIN ".dylib"
+#else /* !__APPLE__ */
+#define STR_EXTENSION_PLUGIN ".so"
+#endif /* __APPLE__ */
+
 namespace nncc
 {
 namespace contrib
@@ -43,7 +49,7 @@ std::vector<std::string> PluginManager::getPluginPathList() {
             (std::string(ent->d_name) != "..")) {
           std::string f = curPluginsPath + std::string("/") + std::string(ent->d_name);
           dirList.push_back(f);
-        } else if (strstr(ent->d_name, ".so") != nullptr) {
+        } else if (strstr(ent->d_name, STR_EXTENSION_PLUGIN) != nullptr) {
           std::string f = curPluginsPath + std::string("/") + std::string(ent->d_name);
           pluginPathList.push_back(f);
         }