fix compile issues

This commit is contained in:
2025-09-05 19:59:51 -05:00
parent e3af31f1e0
commit 4372684d00
4 changed files with 14 additions and 16 deletions

View File

@@ -5,6 +5,7 @@
#include <sys/socket.h> #include <sys/socket.h>
#include <unistd.h> #include <unistd.h>
#include "transfer.h" #include "transfer.h"
#include "logging.h"
using namespace std; using namespace std;

View File

@@ -19,7 +19,7 @@
#define LOGGING_COLOR true // enable color #define LOGGING_COLOR true // enable color
#define LOGGING_TIMESTAMP true // enable timestamp #define LOGGING_TIMESTAMP true // enable timestamp
#define LOGGING_TIMESTAMP_FMT "%Y-%m-%dT%H:%M:%S%z" // timestamp format (local time) #define LOGGING_TIMESTAMP_FMT "%Y-%m-%dT%H:%M:%S%z" // timestamp format (local time)
#define LOGGING_POSITION true // display position (only works on C++20 or newer) #define LOGGING_POSITION false // display position (only works on C++20 or newer)
// Color codes // Color codes
#define ANSI_RESET "\033[0m" #define ANSI_RESET "\033[0m"
@@ -33,15 +33,9 @@
#define ANSI_WHITE "\033[37m" /* White */ #define ANSI_WHITE "\033[37m" /* White */
#define ANSI_BOLD "\033[1m" /* Bold */ #define ANSI_BOLD "\033[1m" /* Bold */
template <typename T> template <typename... Args>
void print(T t) { void print(Args... args) {
std::cout << t << std::endl; (std::cout << ... << args) << "\n";
}
template <typename T, typename... Args>
void print(T t, Args... args) {
std::cout << t;
print(args...);
} }
inline void printTimestamp() { inline void printTimestamp() {
@@ -55,13 +49,11 @@ inline void printTimestamp() {
} }
// if we're on C++20 or later, then use the source_location header and add source location to logs // if we're on C++20 or later, then use the source_location header and add source location to logs
#if __cplusplus >= 202002L #if __cplusplus >= 202002L && LOGGING_POSITION
#include <source_location> #include <source_location>
inline void printPosition(std::source_location& location) { inline void printPosition(std::source_location& location) {
#if LOGGING_POSITION std::cout << location.file_name() << ":" << location.function_name() << ":" << ANSI_CYAN << location.line() << ANSI_RESET << ": ";
std::cout << location.file_name() << ":" << location.function_name << ":" << ANSI_CYAN << location.line() << ANSI_RESET << ": ";
#endif
} }
inline void printHeader(std::string name, std::string color, std::source_location& location) { inline void printHeader(std::string name, std::string color, std::source_location& location) {

View File

@@ -9,6 +9,8 @@ project('video-streaming-poc', 'cpp', version : '0.0.1-SNAPSHOT',
#======================================================================================================================= #=======================================================================================================================
# opencv dependency # opencv dependency
opencv = dependency('opencv4', version : '>=4.0.0') opencv = dependency('opencv4', version : '>=4.0.0')
opencv_incl_dir = opencv.get_variable(cmake : 'OpenCV_INCLUDE_DIRECTORIES', pkgconfig : 'includedir')
include = include_directories(opencv_incl_dir)
# boost dependency # boost dependency
boost = dependency('boost') boost = dependency('boost')
@@ -27,7 +29,9 @@ server = common + ['server.cpp']
#======================================================================================================================= #=======================================================================================================================
# client executable # client executable
client_exe = executable('client', client, client_exe = executable('client', client,
dependencies : [opencv, boost]) dependencies : [opencv, boost],
include_directories : include)
# server executable # server executable
server_exe = executable('server', server, server_exe = executable('server', server,
dependencies : [opencv, boost]) dependencies : [opencv, boost],
include_directories : include)

View File

@@ -6,6 +6,7 @@
#include <sys/socket.h> #include <sys/socket.h>
#include <unistd.h> #include <unistd.h>
#include "transfer.h" #include "transfer.h"
#include "logging.h"
using namespace std; using namespace std;