mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-07 20:09:58 -05:00
Correctly compile if the sync module is compiled without libtorrent support
This commit is contained in:
@@ -87,6 +87,7 @@ void SyncModule::internalInitialize(const ghoul::Dictionary& configuration) {
|
||||
}
|
||||
);
|
||||
|
||||
#ifdef SYNC_USE_LIBTORRENT
|
||||
fSynchronization->registerClass(
|
||||
"TorrentSynchronization",
|
||||
[this](bool, const ghoul::Dictionary& dictionary) {
|
||||
@@ -97,6 +98,7 @@ void SyncModule::internalInitialize(const ghoul::Dictionary& configuration) {
|
||||
);
|
||||
}
|
||||
);
|
||||
#endif // SYNC_USE_LIBTORRENT
|
||||
|
||||
fSynchronization->registerClass(
|
||||
"UrlSynchronization",
|
||||
@@ -112,13 +114,16 @@ void SyncModule::internalInitialize(const ghoul::Dictionary& configuration) {
|
||||
ghoul_assert(fTask, "No task factory existed");
|
||||
fTask->registerClass<SyncAssetTask>("SyncAssetTask");
|
||||
|
||||
#ifdef SYNC_USE_LIBTORRENT
|
||||
_torrentClient.initialize();
|
||||
|
||||
global::callback::deinitialize.emplace_back([&]() { _torrentClient.deinitialize(); });
|
||||
#endif // SYNC_USE_LIBTORRENT
|
||||
}
|
||||
|
||||
void SyncModule::internalDeinitialize() {
|
||||
#ifdef SYNC_USE_LIBTORRENT
|
||||
_torrentClient.deinitialize();
|
||||
#endif // SYNC_USE_LIBTORRENT
|
||||
}
|
||||
|
||||
std::string SyncModule::synchronizationRoot() const {
|
||||
@@ -136,7 +141,9 @@ std::vector<std::string> SyncModule::httpSynchronizationRepositories() const {
|
||||
std::vector<documentation::Documentation> SyncModule::documentations() const {
|
||||
return {
|
||||
HttpSynchronization::Documentation(),
|
||||
#ifdef SYNC_USE_LIBTORRENT
|
||||
TorrentSynchronization::Documentation()
|
||||
#endif // SYNC_USE_LIBTORRENT
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user