fix compile issues
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <sys/socket.h>
|
||||
#include <unistd.h>
|
||||
#include "transfer.h"
|
||||
#include "logging.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
20
logging.h
20
logging.h
@@ -19,7 +19,7 @@
|
||||
#define LOGGING_COLOR true // enable color
|
||||
#define LOGGING_TIMESTAMP true // enable timestamp
|
||||
#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
|
||||
#define ANSI_RESET "\033[0m"
|
||||
@@ -33,15 +33,9 @@
|
||||
#define ANSI_WHITE "\033[37m" /* White */
|
||||
#define ANSI_BOLD "\033[1m" /* Bold */
|
||||
|
||||
template <typename T>
|
||||
void print(T t) {
|
||||
std::cout << t << std::endl;
|
||||
}
|
||||
|
||||
template <typename T, typename... Args>
|
||||
void print(T t, Args... args) {
|
||||
std::cout << t;
|
||||
print(args...);
|
||||
template <typename... Args>
|
||||
void print(Args... args) {
|
||||
(std::cout << ... << args) << "\n";
|
||||
}
|
||||
|
||||
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 __cplusplus >= 202002L
|
||||
#if __cplusplus >= 202002L && LOGGING_POSITION
|
||||
#include <source_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 << ": ";
|
||||
#endif
|
||||
std::cout << location.file_name() << ":" << location.function_name() << ":" << ANSI_CYAN << location.line() << ANSI_RESET << ": ";
|
||||
}
|
||||
|
||||
inline void printHeader(std::string name, std::string color, std::source_location& location) {
|
||||
|
@@ -9,6 +9,8 @@ project('video-streaming-poc', 'cpp', version : '0.0.1-SNAPSHOT',
|
||||
#=======================================================================================================================
|
||||
# opencv dependency
|
||||
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')
|
||||
|
||||
@@ -27,7 +29,9 @@ server = common + ['server.cpp']
|
||||
#=======================================================================================================================
|
||||
# client executable
|
||||
client_exe = executable('client', client,
|
||||
dependencies : [opencv, boost])
|
||||
dependencies : [opencv, boost],
|
||||
include_directories : include)
|
||||
# server executable
|
||||
server_exe = executable('server', server,
|
||||
dependencies : [opencv, boost])
|
||||
dependencies : [opencv, boost],
|
||||
include_directories : include)
|
@@ -6,6 +6,7 @@
|
||||
#include <sys/socket.h>
|
||||
#include <unistd.h>
|
||||
#include "transfer.h"
|
||||
#include "logging.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
Reference in New Issue
Block a user