Fix Logger and other build issues (#7)
All checks were successful
Build ptprnt / build (push) Successful in 1m49s

This branch fixes a couple of issues with the build
- stop linking everything in a library which is then linked against a single main. It doesn't work the way I wanted. If functionality needs to be exposed by a library, it can be done later or with a separate target
- This should also fix spdlog
- Source files are now in a separate meson file using mesons files() feautre
- Improve coverage generation by adding a script generating html coverage reports. This will hopefully keep the motivation higher to create more unit tests
- Increase the code coverage a bit to demonstrate that statement above is not a fluke 😄

Reviewed-on: #7
This commit is contained in:
2023-11-16 20:26:22 +00:00
parent 9a1aee6658
commit cd15930e1d
9 changed files with 101 additions and 45 deletions

View File

@@ -52,6 +52,11 @@ bool Bitmap<T>::setPixels(const std::vector<T>& pixels) {
return true;
}
template <class T>
std::vector<T> Bitmap<T>::getPixelsCpy() {
return mPixels;
}
template <class T>
std::optional<std::vector<T>> Bitmap<T>::getLine(uint16_t line) {
if (line >= mHeight) {

View File

@@ -22,6 +22,7 @@
#include <stdint.h>
#include <cstdint>
#include <memory>
#include <optional>
#include <vector>
@@ -41,6 +42,7 @@ class Bitmap {
uint16_t getWidth();
uint16_t getHeight();
bool setPixels(const std::vector<T>& pixels);
std::vector<T> getPixelsCpy();
std::optional<std::vector<T>> getLine(uint16_t line);
std::optional<std::vector<T>> getCol(uint16_t col);

View File

@@ -16,10 +16,6 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <spdlog/common.h>
#include <spdlog/spdlog.h>
#include "PtouchPrint.hpp"
int main(int argc, char** argv) {

24
src/meson.build Normal file
View File

@@ -0,0 +1,24 @@
ptprnt_hpps = files (
'libusbwrap/interface/IUsbDeviceFactory.hpp',
'libusbwrap/interface/IUsbDevice.hpp',
'libusbwrap/UsbDeviceFactory.hpp',
'libusbwrap/LibUsbTypes.hpp',
'libusbwrap/UsbDevice.hpp',
'interface/IPrinterDriver.hpp',
'interface/IPrinterTypes.hpp',
'P700Printer.hpp',
'PtouchPrint.hpp',
'graphics/Bitmap.hpp',
'graphics/Image.hpp',
'graphics/Monochrome.hpp'
)
ptprnt_srcs = files (
'PtouchPrint.cpp',
'P700Printer.cpp',
'graphics/Image.cpp',
'graphics/Bitmap.cpp',
'graphics/Monochrome.cpp',
'libusbwrap/UsbDeviceFactory.cpp',
'libusbwrap/UsbDevice.cpp',
)