Fix build errors for explicitly using libfmt
Some checks failed
Build ptprnt / build (push) Failing after 35s

This commit is contained in:
2023-11-19 14:22:48 +01:00
parent dd496a325b
commit e2c524f7c9
7 changed files with 12 additions and 8 deletions

View File

@@ -14,7 +14,7 @@ jobs:
- name: install meson - name: install meson
run: apt-get -yq install meson run: apt-get -yq install meson
- name: Install build dependencies - name: Install build dependencies
run: apt-get -yq install libusb-1.0-0-dev libspdlog-dev libpango1.0-dev libcairo2-dev gcovr run: apt-get -yq install libusb-1.0-0-dev libspdlog-dev libfmt-dev libpango1.0-dev libcairo2-dev gcovr
- name: setup builddir - name: setup builddir
run: meson setup builddir -Db_coverage=true run: meson setup builddir -Db_coverage=true
- name: build all targets - name: build all targets

View File

@@ -19,7 +19,7 @@ pacman -S libusb spdlog pango cairo meson gcovr
Install dependencies on Debian/Ubuntu Install dependencies on Debian/Ubuntu
``` bash ``` bash
apt-get install libusb-1.0-0-dev libspdlog-dev libpango1.0-dev libcairo2-dev meson gcovr apt-get install libusb-1.0-0-dev libspdlog-dev libfmt-dev libpango1.0-dev libcairo2-dev meson gcovr
``` ```
## Build ## Build

View File

@@ -6,6 +6,7 @@ project('ptprnt', 'cpp',
usb_dep = dependency('libusb-1.0') usb_dep = dependency('libusb-1.0')
log_dep = dependency('spdlog') log_dep = dependency('spdlog')
fmt_dep = dependency('fmt')
pangocairo_dep = dependency('pangocairo') pangocairo_dep = dependency('pangocairo')
# CLI11 # CLI11
@@ -23,7 +24,7 @@ ptprnt_exe = executable(
'ptprnt', 'ptprnt',
'src/main.cpp', 'src/main.cpp',
install: true, install: true,
dependencies : [usb_dep, log_dep, pangocairo_dep, cli11_dep], dependencies : [usb_dep, log_dep, fmt_dep, pangocairo_dep, cli11_dep],
include_directories: incdir, include_directories: incdir,
sources: [ptprnt_srcs], sources: [ptprnt_srcs],
cpp_args : ['-DPROJ_VERSION="'+meson.project_version()+'"'], cpp_args : ['-DPROJ_VERSION="'+meson.project_version()+'"'],

View File

@@ -30,6 +30,7 @@ namespace ptprnt {
class IPrinterDriver { class IPrinterDriver {
public: public:
virtual ~IPrinterDriver() = default;
virtual const std::string_view getDriverName() = 0; virtual const std::string_view getDriverName() = 0;
virtual const std::string_view getName() = 0; virtual const std::string_view getName() = 0;
virtual const std::string_view getVersion() = 0; virtual const std::string_view getVersion() = 0;

View File

@@ -29,8 +29,8 @@
namespace libusbwrap { namespace libusbwrap {
class UsbDevice : public IUsbDevice { class UsbDevice : public IUsbDevice {
public: public:
UsbDevice(libusb_context* ctx, libusb_device* dev); explicit UsbDevice(libusb_context* ctx, libusb_device* dev);
~UsbDevice(); ~UsbDevice() override;
// delete copy ctor and assignment // delete copy ctor and assignment
UsbDevice(const UsbDevice&) = delete; UsbDevice(const UsbDevice&) = delete;

View File

@@ -24,8 +24,9 @@ enum class Speed {
class IUsbDevice { class IUsbDevice {
public: public:
virtual bool open() = 0; virtual ~IUsbDevice() = default;
virtual void close() = 0; virtual bool open() = 0;
virtual void close() = 0;
// libusb wrappers // libusb wrappers
virtual bool detachKernelDriver(int interfaceNo) = 0; virtual bool detachKernelDriver(int interfaceNo) = 0;

View File

@@ -9,7 +9,8 @@
namespace libusbwrap { namespace libusbwrap {
class IUsbDeviceFactory { class IUsbDeviceFactory {
public: public:
virtual std::vector<std::shared_ptr<IUsbDevice>> findAllDevices() = 0; virtual ~IUsbDeviceFactory() = default;
virtual std::vector<std::shared_ptr<IUsbDevice>> findAllDevices() = 0;
virtual std::vector<std::shared_ptr<IUsbDevice>> findDevices(uint16_t vid, uint16_t pid) = 0; virtual std::vector<std::shared_ptr<IUsbDevice>> findDevices(uint16_t vid, uint16_t pid) = 0;
}; };
} // namespace libusbwrap } // namespace libusbwrap