mirror of https://github.com/gabime/spdlog.git
gcc support
parent
68504fa3e5
commit
b093b82473
@ -0,0 +1,30 @@
|
|||||||
|
CC = g++
|
||||||
|
CCFLAGS = -std=c++11 -pthread -Iinclude -O3 -flto
|
||||||
|
|
||||||
|
all: lib testlog
|
||||||
|
|
||||||
|
testlog: test.o lib
|
||||||
|
$(CC) -o $testlog test.o libc11log.a $(CCFLAGS)
|
||||||
|
|
||||||
|
lib: factory.o formatters.o line_logger.o os.o
|
||||||
|
ar rvs libc11log.a $^;
|
||||||
|
|
||||||
|
|
||||||
|
test.o: src/test.cpp
|
||||||
|
$(CC) -c -o $@ $^ $(CCFLAGS)
|
||||||
|
|
||||||
|
factory.o: src/factory.cpp
|
||||||
|
$(CC) -c -o $@ $^ $(CCFLAGS)
|
||||||
|
|
||||||
|
formatters.o: src/formatters.cpp
|
||||||
|
$(CC) -c -o $@ $^ $(CCFLAGS)
|
||||||
|
|
||||||
|
line_logger.o: src/line_logger.cpp
|
||||||
|
$(CC) -c -o $@ $^ $(CCFLAGS)
|
||||||
|
|
||||||
|
os.o: src/os.cpp
|
||||||
|
$(CC) -c -o $@ $^ $(CCFLAGS)
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
clean:
|
||||||
|
rm *.o
|
@ -0,0 +1,27 @@
|
|||||||
|
// stdafx.h : include file for standard system include files,
|
||||||
|
// or project specific include files that are used frequently, but
|
||||||
|
// are changed infrequently
|
||||||
|
//
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#include "targetver.h"
|
||||||
|
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <chrono>
|
||||||
|
#include <ctime>
|
||||||
|
#include <memory>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _MSC_VER
|
||||||
|
namespace std {
|
||||||
|
template<typename T, typename ...Args>
|
||||||
|
std::unique_ptr<T> make_unique( Args&& ...args )
|
||||||
|
{
|
||||||
|
return std::unique_ptr<T>( new T( std::forward<Args>(args)... ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
@ -1,8 +0,0 @@
|
|||||||
// stdafx.cpp : source file that includes just the standard includes
|
|
||||||
// test.pch will be the pre-compiled header
|
|
||||||
// stdafx.obj will contain the pre-compiled type information
|
|
||||||
|
|
||||||
#include "stdafx.h"
|
|
||||||
|
|
||||||
// TODO: reference any additional headers you need in STDAFX.H
|
|
||||||
// and not in this file
|
|
@ -1,16 +0,0 @@
|
|||||||
// stdafx.h : include file for standard system include files,
|
|
||||||
// or project specific include files that are used frequently, but
|
|
||||||
// are changed infrequently
|
|
||||||
//
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <thread>
|
|
||||||
#include <iostream>
|
|
||||||
#include <chrono>
|
|
||||||
|
|
||||||
#include "utils.h"
|
|
||||||
#include "../include/c11log/logger.h"
|
|
||||||
#include "../include/c11log/sinks/async_sink.h"
|
|
||||||
#include "../include/c11log/sinks/stdout_sinks.h"
|
|
||||||
#include "../include/c11log/sinks/file_sinks.h"
|
|
Loading…
Reference in New Issue