Moved lite source to folders|

This commit is contained in:
gabime 2019-03-30 16:49:02 +03:00
parent c2b0e223fa
commit f36be4d5e4
11 changed files with 412 additions and 407 deletions

View File

@ -89,8 +89,7 @@ if(SPDLOG_BUILD_BENCH)
endif()
if(SPDLOG_BUILD_LITE)
add_subdirectory(lite)
add_subdirectory(lite-example)
add_subdirectory(spdlite)
endif()
#---------------------------------------------------------------------------------------

View File

@ -1,6 +0,0 @@
cmake_minimum_required(VERSION 3.1)
project(spdlog_lite)
add_library(spdlog_lite spdlite.cpp spdlite.h spdlite_global.cpp spdlite_global.h spdlite_macros.h)
target_link_libraries(spdlog_lite spdlog::spdlog)

14
spdlite/CMakeLists.txt Normal file
View File

@ -0,0 +1,14 @@
cmake_minimum_required(VERSION 3.1)
project(spdlite)
include_directories(${PROJECT_SOURCE_DIR}/include)
file(GLOB SRC_FILES ${PROJECT_SOURCE_DIR}/src/*.cpp)
file(GLOB HEADER_FILES ${PROJECT_SOURCE_DIR}/include/*.h)
add_library(spdlite ${SRC_FILES} ${HEADER_FILES})
target_link_libraries(spdlite spdlog::spdlog)
add_subdirectory(example)

View File

@ -1,13 +1,11 @@
project(spdlog-lite-example CXX)
find_package(Threads REQUIRED)
project(spdlite-example CXX)
set(LITE_SOURCES example.cpp create_logger.cpp)
add_executable(${PROJECT_NAME} ${LITE_SOURCES})
include_directories(../lite)
find_package(Threads)
target_link_libraries(${PROJECT_NAME} PRIVATE Threads::Threads)
target_link_libraries(${PROJECT_NAME} PRIVATE spdlog_lite)
target_link_libraries(${PROJECT_NAME} PRIVATE spdlite)

View File

@ -1,7 +1,7 @@
// Copyright(c) 2015-present Gabi Melman.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#include "spdlite.h"
#include "spdlite/spdlite.h"
#include "spdlog/spdlog.h"
#include "spdlog/sinks/basic_file_sink.h"

View File

@ -1,11 +1,11 @@
// Copyright(c) 2015-present Gabi Melman.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#include "spdlite.h"
#include "spdlite_global.h"
#include "spdlite/spdlite.h"
#include "spdlite/spdlite_global.h"
#define SPDLITE_ACTIVE_LEVEL SPDLITE_LEVEL_TRACE
#include "spdlite_macros.h"
#include "spdlite/spdlite_macros.h"
int main()
{
SPDLITE_TRACE("SOME INFO {}", 123);

View File

@ -3,7 +3,7 @@
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
//
#include "spdlite.h"
#include "spdlite/spdlite.h"
#include "spdlog/spdlog.h"
static spdlog::level::level_enum to_spdlog_level(spdlite::level level)

View File

@ -1,7 +1,7 @@
// Copyright(c) 2015-present Gabi Melman.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#include "spdlite_global.h"
#include "spdlite/spdlite_global.h"
spdlite::logger &spdlite::default_logger()
{