Merge pull request #614 from jbeich/basu

mpris: unbreak build with -DUSE_BASU=ON
This commit is contained in:
casey langen 2023-06-17 12:39:36 -07:00 committed by GitHub
commit d723f96360
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 4 deletions

View File

@ -2,12 +2,15 @@ set (mpris_SOURCES
mpris.cpp
dbus.cpp)
if (USE_ELOGIND MATCHES "true")
if (USE_ELOGIND)
set(SDBUS "libelogind >= 239.3")
elseif (USE_BASU MATCHES "true")
set(SDBUS_HEADER "<elogind/sd-bus.h>")
elseif (USE_BASU)
set(SDBUS "basu")
set(SDBUS_HEADER "<basu/sd-bus.h>")
else()
set(SDBUS "libsystemd")
set(SDBUS_HEADER "<systemd/sd-bus.h>")
endif()
find_package(PkgConfig)
@ -18,5 +21,6 @@ if (NOT DEFINED SDBUS_LINK_LIBRARIES)
else()
message(STATUS "[mpris] plugin enabled. using " ${SDBUS_LINK_LIBRARIES})
add_library(mpris SHARED ${mpris_SOURCES})
target_compile_definitions(mpris PUBLIC SDBUS_HEADER=${SDBUS_HEADER})
target_link_libraries(mpris PkgConfig::SDBUS)
endif()

View File

@ -1,7 +1,7 @@
#pragma once
extern "C" {
#include <systemd/sd-bus.h>
#include SDBUS_HEADER
}
extern const sd_bus_vtable musikcube_mp_table[];

View File

@ -8,7 +8,7 @@
#include <memory>
extern "C" {
#include <systemd/sd-bus.h>
#include SDBUS_HEADER
}
using namespace musik::core::sdk;