Ensure translations for service aren't removed

* Add those files unconditionally
* Add conditions inside the files instead
This commit is contained in:
Martchus 2017-01-14 21:36:37 +01:00
parent 30b5be70d0
commit 3d088948fd
3 changed files with 8 additions and 12 deletions

View File

@ -16,6 +16,7 @@ set(HEADER_FILES
syncthingconnectionsettings.h
syncthingconfig.h
syncthingprocess.h
syncthingservice.h
utils.h
)
set(SRC_FILES
@ -25,6 +26,7 @@ set(SRC_FILES
syncthingconnectionsettings.cpp
syncthingconfig.cpp
syncthingprocess.cpp
syncthingservice.cpp
utils.cpp
)
@ -50,12 +52,6 @@ list(APPEND ADDITIONAL_QT_MODULES Network)
# configure support for controlling Syncthing via systemd service
option(SYSTEMD_SUPPORT "enables support for controlling Syncthing systemd service" ${UNIX})
if(SYSTEMD_SUPPORT)
list(APPEND HEADER_FILES
syncthingservice.h
)
list(APPEND SRC_FILES
syncthingservice.cpp
)
list(APPEND DBUS_FILES
org.freedesktop.DBus.Properties.xml
org.freedesktop.systemd1.Manager.xml
@ -69,10 +65,6 @@ if(SYSTEMD_SUPPORT)
list(APPEND META_PUBLIC_COMPILE_DEFINITIONS LIB_SYNCTHING_CONNECTOR_SUPPORT_SYSTEMD)
message(STATUS "systemd support enabled")
else()
list(APPEND DOC_ONLY_FILES
syncthingservice.h
syncthingservice.cpp
)
message(STATUS "systemd support disabled")
endif()

View File

@ -1,3 +1,5 @@
#ifdef LIB_SYNCTHING_CONNECTOR_SUPPORT_SYSTEMD
#include "./syncthingservice.h"
#include "managerinterface.h"
@ -287,3 +289,5 @@ SyncthingService &syncthingService()
}
} // namespace Data
#endif

View File

@ -1,4 +1,4 @@
#ifndef DATA_SYNCTHINGSERVICE_H
#if defined(LIB_SYNCTHING_CONNECTOR_SUPPORT_SYSTEMD) && !defined(DATA_SYNCTHINGSERVICE_H)
#define DATA_SYNCTHINGSERVICE_H
#include <c++utilities/chrono/datetime.h>
@ -193,4 +193,4 @@ SyncthingService &syncthingService();
Q_DECLARE_METATYPE(Data::ManagerDBusUnitFileChange)
Q_DECLARE_METATYPE(Data::ManagerDBusUnitFileChangeList)
#endif // DATA_SYNCTHINGSERVICE_H
#endif // defined(LIB_SYNCTHING_CONNECTOR_SUPPORT_SYSTEMD) && !defined(DATA_SYNCTHINGSERVICE_H)