restructure project

This commit is contained in:
Benjamin Sergeant
2019-09-10 12:19:22 -07:00
parent c09015e870
commit 0fde169aa4
26 changed files with 119 additions and 44 deletions

19
ixcore/CMakeLists.txt Normal file
View File

@ -0,0 +1,19 @@
#
# Author: Benjamin Sergeant
# Copyright (c) 2019 Machine Zone, Inc. All rights reserved.
#
set (IXCORE_SOURCES
ixcore/utils/IXCoreLogger.cpp
)
set (IXCORE_HEADERS
ixcore/utils/IXCoreLogger.h
)
add_library(ixcore STATIC
${IXCORE_SOURCES}
${IXCORE_HEADERS}
)
target_include_directories( ixcore PUBLIC . )

View File

@ -0,0 +1,14 @@
#include "ixcore/utils/IXCoreLogger.h"
namespace ix
{
// Default do nothing logger
IXCoreLogger::LogFunc IXCoreLogger::_currentLogger = [](const char* /*msg*/){};
void IXCoreLogger::Log(const char* msg)
{
_currentLogger(msg);
}
} // ix

View File

@ -0,0 +1,18 @@
#pragma once
#include <functional>
namespace ix
{
class IXCoreLogger
{
public:
using LogFunc = std::function<void(const char*)>;
static void Log(const char* msg);
static void setLogFunction(LogFunc& func) { _currentLogger = func; }
private:
static LogFunc _currentLogger;
};
} // namespace ix