feat: add shared library build and example application

This commit is contained in:
user
2026-07-19 17:53:57 +04:00
parent 0e0eb1e8e5
commit 0c5b288833
5 changed files with 107 additions and 1 deletions
+41
View File
@@ -0,0 +1,41 @@
ROOT_DIR := $(abspath ..)
CC := gcc
CXXFLAGS := -std=c++17 \
-Wall \
-Wextra \
-Werror \
-I$(ROOT_DIR)/core/include \
-I$(ROOT_DIR)/logger/include
LDFLAGS := -L$(ROOT_DIR)/build \
-llogger \
-lstdc++ \
-Wl,-rpath,$(ROOT_DIR)/build
BUILD_DIR := $(ROOT_DIR)/build
TARGET := $(BUILD_DIR)/logger_app
SRC := src/main.cpp
.PHONY: all clean
all: $(TARGET)
$(TARGET): $(SRC)
@mkdir -p $(BUILD_DIR)
$(CC) \
$(CXXFLAGS) \
$< \
-o $@ \
$(LDFLAGS)
clean:
rm -f $(TARGET)
+17
View File
@@ -0,0 +1,17 @@
#include <iostream>
#include "logger.hpp"
int main() {
logger::Logger logger("app.log", logger::LogLevel::info());
auto status = logger.writeMessage("Hello from shared library");
if (!status.isSuccess()) {
std::cerr << status.getError() << '\n';
return 1;
}
return 0;
}