Make SAC and WMDM optional

This commit is contained in:
Руслан Ижбулатов 2012-01-15 19:32:04 +04:00 committed by David Sansome
parent bc0623bc0d
commit 5c45e22e28
6 changed files with 21 additions and 9 deletions

View File

@ -197,6 +197,9 @@ option(ENABLE_PLASMARUNNER "Enable plasma krunner global search" OFF)
if(WIN32)
option(ENABLE_WIN32_CONSOLE "Show the windows console even outside Debug mode" OFF)
if(SAC_SHIM_LIBRARIES)
set(HAVE_SAC ON)
endif(SAC_SHIM_LIBRARIES)
endif(WIN32)
if(ENABLE_LIBGPOD AND LIBGPOD_FOUND)

View File

@ -902,7 +902,7 @@ optional_source(HAVE_LIBMTP
)
# Windows media lister
optional_source(WIN32
optional_source(HAVE_SAC
SOURCES
devices/wmdmdevice.cpp
devices/wmdmlister.cpp
@ -1082,10 +1082,14 @@ if (WIN32)
target_link_libraries(clementine_lib
${ZLIB_LIBRARIES}
${MSWMDM_LIBRARIES}
${SAC_SHIM_LIBRARIES}
${QTSPARKLE_LIBRARIES}
qtwin
)
if (HAVE_SAC)
target_link_libraries(clementine_lib
${SAC_SHIM_LIBRARIES}
)
endif (HAVE_SAC)
endif (WIN32)
if (LINUX)

View File

@ -34,6 +34,7 @@
#cmakedefine HAVE_LIBMTP
#cmakedefine HAVE_QCA
#cmakedefine HAVE_REMOTE
#cmakedefine HAVE_SAC
#cmakedefine HAVE_SPARKLE
#cmakedefine HAVE_SPOTIFY
#cmakedefine HAVE_STATIC_SQLITE

View File

@ -42,7 +42,9 @@
#include <id3v1genres.h>
#ifdef Q_OS_WIN32
# include <mswmdm.h>
# ifdef HAVE_SAC
# include <mswmdm.h>
# endif
# include <QUuid>
#endif // Q_OS_WIN32
@ -697,7 +699,7 @@ void Song::InitFromLastFM(const lastfm::Track& track) {
}
#endif
#ifdef Q_OS_WIN32
#if defined(Q_OS_WIN32) && defined(HAVE_SAC)
static void AddWmdmItem(IWMDMMetaData* metadata, const wchar_t* name,
const QVariant& value) {
switch (value.type()) {

View File

@ -39,7 +39,7 @@ class QUrl;
struct LIBMTP_track_struct;
#endif
#ifdef Q_OS_WIN32
#if defined(Q_OS_WIN32) && defined(HAVE_SAC)
struct IWMDMMetaData;
#endif
@ -117,7 +117,7 @@ class Song {
void ToMTP(LIBMTP_track_struct* track) const;
#endif
#ifdef Q_OS_WIN32
#if defined(Q_OS_WIN32) && defined(HAVE_SAC)
void InitFromWmdm(IWMDMMetaData* metadata);
void ToWmdm(IWMDMMetaData* metadata) const;
#endif

View File

@ -36,8 +36,10 @@
# include "macdevicelister.h"
#endif
#ifdef Q_OS_WIN32
# include "wmdmlister.h"
# include "wmdmdevice.h"
# ifdef HAVE_SAC
# include "wmdmlister.h"
# include "wmdmdevice.h"
# endif
#endif
#ifdef HAVE_LIBGPOD
# include "gpoddevice.h"
@ -201,7 +203,7 @@ DeviceManager::DeviceManager(BackgroundThread<Database>* database,
#ifdef Q_OS_DARWIN
AddLister(new MacDeviceLister);
#endif
#ifdef Q_OS_WIN32
#if defined(Q_OS_WIN32) && defined(HAVE_SAC)
AddLister(new WmdmLister);
AddDeviceClass<WmdmDevice>();
#endif