diff OrthancServer/main.cpp @ 1632:eb8fbcf008b5

fix build with plugins disabled
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 21 Sep 2015 14:05:06 +0200
parents ffd23c0104af
children 1558b3226b18
line wrap: on
line diff
--- a/OrthancServer/main.cpp	Mon Sep 21 13:33:50 2015 +0200
+++ b/OrthancServer/main.cpp	Mon Sep 21 14:05:06 2015 +0200
@@ -368,6 +368,8 @@
 }
 
 
+
+#if ORTHANC_PLUGINS_ENABLED == 1
 static void LoadPlugins(OrthancPlugins& plugins)
 {
   std::list<std::string> path;
@@ -380,6 +382,7 @@
     plugins.GetManager().RegisterPlugin(path);
   }  
 }
+#endif
 
 
 
@@ -496,6 +499,7 @@
 static bool ConfigureHttpHandler(ServerContext& context,
                                  OrthancPlugins *plugins)
 {
+#if ORTHANC_PLUGINS_ENABLED == 1
   // By order of priority, first apply the "plugins" layer, so that
   // plugins can overwrite the built-in REST API of Orthanc
   if (plugins)
@@ -503,6 +507,7 @@
     assert(context.HasPlugins());
     context.GetHttpHandler().Register(*plugins, false);
   }
+#endif
 
   // Secondly, apply the "static resources" layer
 #if ORTHANC_STANDALONE == 1
@@ -593,19 +598,23 @@
 
   LoadLuaScripts(context);
 
+#if ORTHANC_PLUGINS_ENABLED == 1
   if (plugins)
   {
     plugins->SetServerContext(context);
     context.SetPlugins(*plugins);
   }
+#endif
 
   bool restart = ConfigureHttpHandler(context, plugins);
   context.Stop();
 
+#if ORTHANC_PLUGINS_ENABLED == 1
   if (plugins)
   {
     context.ResetPlugins();
   }
+#endif
 
   return restart;
 }