This commit is contained in:
WSAL Evan
2025-09-30 11:55:21 -04:00
parent e0652a87d9
commit 2f0baf3e02
6 changed files with 51 additions and 17 deletions
+13 -2
View File
@@ -5,7 +5,7 @@ set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_library(WVCore STATIC
src/Test.cpp
src/temp.cpp
)
target_include_directories(WVCore PUBLIC
@@ -13,4 +13,15 @@ target_include_directories(WVCore PUBLIC
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_compile_features(WVCore PUBLIC cxx_std_20)
target_compile_features(WVCore PUBLIC cxx_std_20)
# Add platform-specific preprocessor definitions
if(WIN32)
target_compile_definitions(WVCore PUBLIC PLATFORM_WINDOWS)
elseif(APPLE)
target_compile_definitions(WVCore PUBLIC PLATFORM_MACOS)
elseif(UNIX)
target_compile_definitions(WVCore PUBLIC PLATFORM_LINUX)
else()
message(FATAL_ERROR "Unknown platform!")
endif()
+35
View File
@@ -0,0 +1,35 @@
#pragma once
#include <cstdio>
#include <ctime>
#define LOG_COLOR_RESET "\x1b[0m"
#define LOG_COLOR_APP_WARN "\x1b[93m"
#define LOG_COLOR_APP_ERROR "\x1b[91m"
#define LOG_COLOR_ENGINE_LOG "\x1b[32m"
#define LOG_COLOR_ENGINE_WARN "\x1b[33m"
#define LOG_COLOR_ENGINE_ERROR "\x1b[41m"
namespace WillowVox
{
class Logger
{
public:
template <typename... Args>
static void Log(const char* message, Args... args)
{
std::time_t t = std::time(nullptr);
std::tm now;
#ifdef _WIN32
localtime_s(&now, &t);
#else
localtime_r(&t, &now);
#endif
printf(LOG_COLOR_RESET "[%02d:%02d:%02d] ", now.tm_hour, now.tm_min, now.tm_sec);
printf(message, args...);
printf(LOG_COLOR_RESET "\n");
}
};
}
-4
View File
@@ -1,4 +0,0 @@
namespace WillowVox::Core
{
void Test();
}
+3
View File
@@ -0,0 +1,3 @@
#pragma once
#include <core/Logger.h>
-11
View File
@@ -1,11 +0,0 @@
#include <core/Test.h>
#include <iostream>
namespace WillowVox::Core
{
void Test()
{
std::cout << "Running Core Update Test..." << std::endl;
}
}
View File