[LmsAPI] Fix build

This commit is contained in:
emeric
2015-07-29 18:07:23 +02:00
parent 1c62194935
commit 16defc4f46
6 changed files with 35 additions and 25 deletions
+8 -9
View File
@@ -19,6 +19,7 @@
#include <boost/filesystem.hpp>
#include "config/config.h"
#include "logger/Logger.hpp"
#include "config/ConfigReader.hpp"
@@ -28,7 +29,9 @@
#include "service/ServiceManager.hpp"
#include "service/DatabaseUpdateService.hpp"
#include "service/UserInterfaceService.hpp"
#if defined HAVE_LMSAPI
#include "service/LmsAPIServerService.hpp"
#endif
int main(int argc, char* argv[])
{
@@ -81,9 +84,6 @@ int main(int argc, char* argv[])
Service::UserInterfaceService::Config uiConfig;
configReader.getUserInterfaceConfig(uiConfig);
Service::RemoteServerService::Config remoteConfig;
configReader.getRemoteServerConfig(remoteConfig);
Service::ServiceManager& serviceManager = Service::ServiceManager::instance();
// lib init
@@ -96,14 +96,13 @@ int main(int argc, char* argv[])
if (dbUpdateConfig.enable)
serviceManager.startService( std::make_shared<Service::DatabaseUpdateService>( dbUpdateConfig ) );
if (remoteConfig.enable)
{
#if defined HAVE_LMSAPI
serviceManager.startService( std::make_shared<Service::RemoteServerService>( remoteConfig ));
#else
LMS_LOG(MOD_MAIN, SEV_ERROR) << "LMS API cannot be activated since it is not compiled";
Service::LmsAPIService::Config lmsAPIConfig;
configReader.getLmsAPIConfig(lmsAPIConfig);
if (lmsAPIConfig.enable)
serviceManager.startService( std::make_shared<Service::LmsAPIService>( lmsAPIConfig ));
#endif
}
if (uiConfig.enable)
serviceManager.startService( std::make_shared<Service::UserInterfaceService>(boost::filesystem::path(argv[0]), uiConfig));