mirror of https://github.com/gabime/spdlog.git
no streams
parent
34bb86b293
commit
7885aa478c
@ -1,48 +1,48 @@
|
|||||||
# Compiled Object files
|
# Compiled Object files
|
||||||
*.slo
|
*.slo
|
||||||
*.lo
|
*.lo
|
||||||
*.o
|
*.o
|
||||||
*.obj
|
*.obj
|
||||||
|
|
||||||
# Compiled Dynamic libraries
|
# Compiled Dynamic libraries
|
||||||
*.so
|
*.so
|
||||||
*.dylib
|
*.dylib
|
||||||
*.dll
|
*.dll
|
||||||
|
|
||||||
# Compiled Static libraries
|
# Compiled Static libraries
|
||||||
*.lai
|
*.lai
|
||||||
*.la
|
*.la
|
||||||
*.a
|
*.a
|
||||||
*.lib
|
*.lib
|
||||||
|
|
||||||
# Executables
|
# Executables
|
||||||
*.exe
|
*.exe
|
||||||
*.out
|
*.out
|
||||||
*.app
|
*.app
|
||||||
|
|
||||||
# Codelite
|
# Codelite
|
||||||
.codelite
|
.codelite
|
||||||
|
|
||||||
# .orig files
|
# .orig files
|
||||||
*.orig
|
*.orig
|
||||||
|
|
||||||
# example files
|
# example files
|
||||||
example/*
|
example/*
|
||||||
!example/example.cpp
|
!example/example.cpp
|
||||||
!example/bench.cpp
|
!example/bench.cpp
|
||||||
!example/utils.h
|
!example/utils.h
|
||||||
!example/Makefile*
|
!example/Makefile*
|
||||||
!example/example.sln
|
!example/example.sln
|
||||||
!example/example.vcxproj
|
!example/example.vcxproj
|
||||||
!example/CMakeLists.txt
|
!example/CMakeLists.txt
|
||||||
|
|
||||||
# generated files
|
# generated files
|
||||||
generated
|
generated
|
||||||
|
|
||||||
# Cmake
|
# Cmake
|
||||||
CMakeCache.txt
|
CMakeCache.txt
|
||||||
CMakeFiles
|
CMakeFiles
|
||||||
CMakeScripts
|
CMakeScripts
|
||||||
Makefile
|
Makefile
|
||||||
cmake_install.cmake
|
cmake_install.cmake
|
||||||
install_manifest.txt
|
install_manifest.txt
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
spdlog is header only library.
|
spdlog is header only library.
|
||||||
Just copy the files to your build tree and use a C++11 compiler
|
Just copy the files to your build tree and use a C++11 compiler
|
||||||
|
|
||||||
Tested on:
|
Tested on:
|
||||||
gcc 4.8.1 and above
|
gcc 4.8.1 and above
|
||||||
clang 3.5
|
clang 3.5
|
||||||
Visual Studio 2013
|
Visual Studio 2013
|
||||||
|
|
||||||
gcc 4.8 flags: --std==c++11 -pthread -O3 -flto -Wl,--no-as-needed
|
gcc 4.8 flags: --std==c++11 -pthread -O3 -flto -Wl,--no-as-needed
|
||||||
gcc 4.9 flags: --std=c++11 -pthread -O3 -flto
|
gcc 4.9 flags: --std=c++11 -pthread -O3 -flto
|
||||||
|
|
||||||
|
|
||||||
see the makefile in the example folder
|
see the makefile in the example folder
|
||||||
|
@ -1,22 +1,22 @@
|
|||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2016 Gabi Melman.
|
Copyright (c) 2016 Gabi Melman.
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
in the Software without restriction, including without limitation the rights
|
in the Software without restriction, including without limitation the rights
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
furnished to do so, subject to the following conditions:
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
The above copyright notice and this permission notice shall be included in
|
||||||
all copies or substantial portions of the Software.
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
@ -1,57 +1,57 @@
|
|||||||
CXX ?= g++
|
CXX ?= g++
|
||||||
CXXFLAGS = -D_WIN32_WINNT=0x600 -march=native -Wall -Wextra -pedantic -std=c++11 -pthread -Wl,--no-as-needed -I../include
|
CXXFLAGS = -D_WIN32_WINNT=0x600 -march=native -Wall -Wextra -pedantic -std=c++11 -pthread -Wl,--no-as-needed -I../include
|
||||||
CXX_RELEASE_FLAGS = -O3 -flto
|
CXX_RELEASE_FLAGS = -O3 -flto
|
||||||
|
|
||||||
|
|
||||||
binaries=spdlog-bench spdlog-bench-mt spdlog-async boost-bench boost-bench-mt glog-bench glog-bench-mt g2log-async easylogging-bench easylogging-bench-mt
|
binaries=spdlog-bench spdlog-bench-mt spdlog-async boost-bench boost-bench-mt glog-bench glog-bench-mt g2log-async easylogging-bench easylogging-bench-mt
|
||||||
|
|
||||||
all: $(binaries)
|
all: $(binaries)
|
||||||
|
|
||||||
spdlog-bench: spdlog-bench.cpp
|
spdlog-bench: spdlog-bench.cpp
|
||||||
$(CXX) spdlog-bench.cpp -o spdlog-bench $(CXXFLAGS) $(CXX_RELEASE_FLAGS)
|
$(CXX) spdlog-bench.cpp -o spdlog-bench $(CXXFLAGS) $(CXX_RELEASE_FLAGS)
|
||||||
|
|
||||||
spdlog-bench-mt: spdlog-bench-mt.cpp
|
spdlog-bench-mt: spdlog-bench-mt.cpp
|
||||||
$(CXX) spdlog-bench-mt.cpp -o spdlog-bench-mt $(CXXFLAGS) $(CXX_RELEASE_FLAGS)
|
$(CXX) spdlog-bench-mt.cpp -o spdlog-bench-mt $(CXXFLAGS) $(CXX_RELEASE_FLAGS)
|
||||||
|
|
||||||
spdlog-async: spdlog-async.cpp
|
spdlog-async: spdlog-async.cpp
|
||||||
$(CXX) spdlog-async.cpp -o spdlog-async $(CXXFLAGS) $(CXX_RELEASE_FLAGS)
|
$(CXX) spdlog-async.cpp -o spdlog-async $(CXXFLAGS) $(CXX_RELEASE_FLAGS)
|
||||||
|
|
||||||
|
|
||||||
BOOST_FLAGS = -DBOOST_LOG_DYN_LINK -I/home/gabi/devel/boost_1_56_0/ -L/home/gabi/devel/boost_1_56_0/stage/lib -lboost_log -lboost_log_setup -lboost_filesystem -lboost_system -lboost_thread -lboost_regex -lboost_date_time -lboost_chrono
|
BOOST_FLAGS = -DBOOST_LOG_DYN_LINK -I/home/gabi/devel/boost_1_56_0/ -L/home/gabi/devel/boost_1_56_0/stage/lib -lboost_log -lboost_log_setup -lboost_filesystem -lboost_system -lboost_thread -lboost_regex -lboost_date_time -lboost_chrono
|
||||||
|
|
||||||
boost-bench: boost-bench.cpp
|
boost-bench: boost-bench.cpp
|
||||||
$(CXX) boost-bench.cpp -o boost-bench $(CXXFLAGS) $(BOOST_FLAGS) $(CXX_RELEASE_FLAGS)
|
$(CXX) boost-bench.cpp -o boost-bench $(CXXFLAGS) $(BOOST_FLAGS) $(CXX_RELEASE_FLAGS)
|
||||||
|
|
||||||
boost-bench-mt: boost-bench-mt.cpp
|
boost-bench-mt: boost-bench-mt.cpp
|
||||||
$(CXX) boost-bench-mt.cpp -o boost-bench-mt $(CXXFLAGS) $(BOOST_FLAGS) $(CXX_RELEASE_FLAGS)
|
$(CXX) boost-bench-mt.cpp -o boost-bench-mt $(CXXFLAGS) $(BOOST_FLAGS) $(CXX_RELEASE_FLAGS)
|
||||||
|
|
||||||
|
|
||||||
GLOG_FLAGS = -lglog
|
GLOG_FLAGS = -lglog
|
||||||
glog-bench: glog-bench.cpp
|
glog-bench: glog-bench.cpp
|
||||||
$(CXX) glog-bench.cpp -o glog-bench $(CXXFLAGS) $(GLOG_FLAGS) $(CXX_RELEASE_FLAGS)
|
$(CXX) glog-bench.cpp -o glog-bench $(CXXFLAGS) $(GLOG_FLAGS) $(CXX_RELEASE_FLAGS)
|
||||||
|
|
||||||
glog-bench-mt: glog-bench-mt.cpp
|
glog-bench-mt: glog-bench-mt.cpp
|
||||||
$(CXX) glog-bench-mt.cpp -o glog-bench-mt $(CXXFLAGS) $(GLOG_FLAGS) $(CXX_RELEASE_FLAGS)
|
$(CXX) glog-bench-mt.cpp -o glog-bench-mt $(CXXFLAGS) $(GLOG_FLAGS) $(CXX_RELEASE_FLAGS)
|
||||||
|
|
||||||
|
|
||||||
G2LOG_FLAGS = -I/home/gabi/devel/g2log/g2log/src -L/home/gabi/devel/g2log/g2log -llib_g2logger
|
G2LOG_FLAGS = -I/home/gabi/devel/g2log/g2log/src -L/home/gabi/devel/g2log/g2log -llib_g2logger
|
||||||
g2log-async: g2log-async.cpp
|
g2log-async: g2log-async.cpp
|
||||||
$(CXX) g2log-async.cpp -o g2log-async $(CXXFLAGS) $(G2LOG_FLAGS) $(CXX_RELEASE_FLAGS)
|
$(CXX) g2log-async.cpp -o g2log-async $(CXXFLAGS) $(G2LOG_FLAGS) $(CXX_RELEASE_FLAGS)
|
||||||
|
|
||||||
|
|
||||||
EASYL_FLAGS = -I../../easylogging/src/
|
EASYL_FLAGS = -I../../easylogging/src/
|
||||||
easylogging-bench: easylogging-bench.cpp
|
easylogging-bench: easylogging-bench.cpp
|
||||||
$(CXX) easylogging-bench.cpp -o easylogging-bench $(CXXFLAGS) $(EASYL_FLAGS) $(CXX_RELEASE_FLAGS)
|
$(CXX) easylogging-bench.cpp -o easylogging-bench $(CXXFLAGS) $(EASYL_FLAGS) $(CXX_RELEASE_FLAGS)
|
||||||
easylogging-bench-mt: easylogging-bench-mt.cpp
|
easylogging-bench-mt: easylogging-bench-mt.cpp
|
||||||
$(CXX) easylogging-bench-mt.cpp -o easylogging-bench-mt $(CXXFLAGS) $(EASYL_FLAGS) $(CXX_RELEASE_FLAGS)
|
$(CXX) easylogging-bench-mt.cpp -o easylogging-bench-mt $(CXXFLAGS) $(EASYL_FLAGS) $(CXX_RELEASE_FLAGS)
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o logs/* $(binaries)
|
rm -f *.o logs/* $(binaries)
|
||||||
|
|
||||||
|
|
||||||
rebuild: clean all
|
rebuild: clean all
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
* GLOBAL:
|
* GLOBAL:
|
||||||
FORMAT = "[%datetime]: %msg"
|
FORMAT = "[%datetime]: %msg"
|
||||||
FILENAME = ./logs/easylogging.log
|
FILENAME = ./logs/easylogging.log
|
||||||
ENABLED = true
|
ENABLED = true
|
||||||
TO_FILE = true
|
TO_FILE = true
|
||||||
TO_STANDARD_OUTPUT = false
|
TO_STANDARD_OUTPUT = false
|
||||||
MILLISECONDS_WIDTH = 3
|
MILLISECONDS_WIDTH = 3
|
||||||
PERFORMANCE_TRACKING = false
|
PERFORMANCE_TRACKING = false
|
||||||
MAX_LOG_FILE_SIZE = 10485760
|
MAX_LOG_FILE_SIZE = 10485760
|
||||||
Log_Flush_Threshold = 10485760
|
Log_Flush_Threshold = 10485760
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# Ignore everything in this directory
|
# Ignore everything in this directory
|
||||||
*
|
*
|
||||||
# Except this file
|
# Except this file
|
||||||
!.gitignore
|
!.gitignore
|
||||||
|
@ -1,76 +0,0 @@
|
|||||||
#~/bin/bash
|
|
||||||
#execute each bench 3 times and print the timing
|
|
||||||
|
|
||||||
exec 2>&1
|
|
||||||
|
|
||||||
#execute and time given exe 3 times
|
|
||||||
bench_exe ()
|
|
||||||
{
|
|
||||||
echo "**************** $1 ****************"
|
|
||||||
for i in {1..3}; do
|
|
||||||
time ./$1 $2;
|
|
||||||
rm -f logs/*
|
|
||||||
sleep 3
|
|
||||||
done;
|
|
||||||
}
|
|
||||||
|
|
||||||
#execute given async tests 3 times (timing is already builtin)
|
|
||||||
bench_async ()
|
|
||||||
{
|
|
||||||
echo "**************** $1 ****************"
|
|
||||||
for i in {1..3}; do
|
|
||||||
./$1 $2;
|
|
||||||
echo
|
|
||||||
rm -f logs/*
|
|
||||||
sleep 3
|
|
||||||
done;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
echo "----------------------------------------------------------"
|
|
||||||
echo "Single threaded benchmarks.. (1 thread, 1,000,000 lines)"
|
|
||||||
echo "----------------------------------------------------------"
|
|
||||||
for exe in boost-bench glog-bench easylogging-bench zf_log-bench spdlog-bench;
|
|
||||||
do
|
|
||||||
bench_exe $exe 1
|
|
||||||
done;
|
|
||||||
|
|
||||||
echo "----------------------------------------------------------"
|
|
||||||
echo "Multi threaded benchmarks.. (10 threads, 1,000,000 lines)"
|
|
||||||
echo "----------------------------------------------------------"
|
|
||||||
for exe in boost-bench-mt glog-bench-mt easylogging-bench-mt zf_log-bench-mt spdlog-bench-mt;
|
|
||||||
do
|
|
||||||
bench_exe $exe 10
|
|
||||||
done;
|
|
||||||
|
|
||||||
echo "----------------------------------------------------------"
|
|
||||||
echo "Multi threaded benchmarks.. (100 threads, 1,000,000 lines)"
|
|
||||||
echo "----------------------------------------------------------"
|
|
||||||
for exe in boost-bench-mt glog-bench-mt easylogging-bench-mt zf_log-bench-mt spdlog-bench-mt;
|
|
||||||
do
|
|
||||||
bench_exe $exe 100
|
|
||||||
done;
|
|
||||||
|
|
||||||
echo "---------------------------------------------------------------"
|
|
||||||
echo "Async, single threaded benchmark.. (1 thread, 1,000,000 lines)"
|
|
||||||
echo "---------------------------------------------------------------"
|
|
||||||
for exe in spdlog-async g2log-async
|
|
||||||
do
|
|
||||||
bench_async $exe 1
|
|
||||||
done;
|
|
||||||
|
|
||||||
echo "---------------------------------------------------------------"
|
|
||||||
echo "Async, multi threaded benchmark.. (10 threads, 1,000,000 lines)"
|
|
||||||
echo "---------------------------------------------------------------"
|
|
||||||
for exe in spdlog-async g2log-async
|
|
||||||
do
|
|
||||||
bench_async $exe 10
|
|
||||||
done;
|
|
||||||
|
|
||||||
echo "---------------------------------------------------------------"
|
|
||||||
echo "Async, multi threaded benchmark.. (100 threads, 1,000,000 lines)"
|
|
||||||
echo "---------------------------------------------------------------"
|
|
||||||
for exe in spdlog-async g2log-async
|
|
||||||
do
|
|
||||||
bench_async $exe 100
|
|
||||||
done;
|
|
@ -1,24 +1,24 @@
|
|||||||
# *************************************************************************/
|
# *************************************************************************/
|
||||||
# * Copyright (c) 2015 Ruslan Baratov. */
|
# * Copyright (c) 2015 Ruslan Baratov. */
|
||||||
# * */
|
# * */
|
||||||
# * Permission is hereby granted, free of charge, to any person obtaining */
|
# * Permission is hereby granted, free of charge, to any person obtaining */
|
||||||
# * a copy of this software and associated documentation files (the */
|
# * a copy of this software and associated documentation files (the */
|
||||||
# * "Software"), to deal in the Software without restriction, including */
|
# * "Software"), to deal in the Software without restriction, including */
|
||||||
# * without limitation the rights to use, copy, modify, merge, publish, */
|
# * without limitation the rights to use, copy, modify, merge, publish, */
|
||||||
# * distribute, sublicense, and/or sell copies of the Software, and to */
|
# * distribute, sublicense, and/or sell copies of the Software, and to */
|
||||||
# * permit persons to whom the Software is furnished to do so, subject to */
|
# * permit persons to whom the Software is furnished to do so, subject to */
|
||||||
# * the following conditions: */
|
# * the following conditions: */
|
||||||
# * */
|
# * */
|
||||||
# * The above copyright notice and this permission notice shall be */
|
# * The above copyright notice and this permission notice shall be */
|
||||||
# * included in all copies or substantial portions of the Software. */
|
# * included in all copies or substantial portions of the Software. */
|
||||||
# * */
|
# * */
|
||||||
# * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
# * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
||||||
# * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
# * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
||||||
# * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
# * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
||||||
# * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
# * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
||||||
# * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
# * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
||||||
# * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
# * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
||||||
# * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
# * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
# *************************************************************************/
|
# *************************************************************************/
|
||||||
|
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake")
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
prefix=@CMAKE_INSTALL_PREFIX@
|
prefix=@CMAKE_INSTALL_PREFIX@
|
||||||
includedir=${prefix}/include
|
includedir=${prefix}/include
|
||||||
|
|
||||||
Name: @PROJECT_NAME@
|
Name: @PROJECT_NAME@
|
||||||
Description: Super fast C++ logging library.
|
Description: Super fast C++ logging library.
|
||||||
Version: @PROJECT_VERSION@
|
Version: @PROJECT_VERSION@
|
||||||
|
@ -1,46 +1,46 @@
|
|||||||
# *************************************************************************/
|
# *************************************************************************/
|
||||||
# * Copyright (c) 2015 Ruslan Baratov. */
|
# * Copyright (c) 2015 Ruslan Baratov. */
|
||||||
# * */
|
# * */
|
||||||
# * Permission is hereby granted, free of charge, to any person obtaining */
|
# * Permission is hereby granted, free of charge, to any person obtaining */
|
||||||
# * a copy of this software and associated documentation files (the */
|
# * a copy of this software and associated documentation files (the */
|
||||||
# * "Software"), to deal in the Software without restriction, including */
|
# * "Software"), to deal in the Software without restriction, including */
|
||||||
# * without limitation the rights to use, copy, modify, merge, publish, */
|
# * without limitation the rights to use, copy, modify, merge, publish, */
|
||||||
# * distribute, sublicense, and/or sell copies of the Software, and to */
|
# * distribute, sublicense, and/or sell copies of the Software, and to */
|
||||||
# * permit persons to whom the Software is furnished to do so, subject to */
|
# * permit persons to whom the Software is furnished to do so, subject to */
|
||||||
# * the following conditions: */
|
# * the following conditions: */
|
||||||
# * */
|
# * */
|
||||||
# * The above copyright notice and this permission notice shall be */
|
# * The above copyright notice and this permission notice shall be */
|
||||||
# * included in all copies or substantial portions of the Software. */
|
# * included in all copies or substantial portions of the Software. */
|
||||||
# * */
|
# * */
|
||||||
# * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
# * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
||||||
# * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
# * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
||||||
# * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
# * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
||||||
# * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
# * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
||||||
# * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
# * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
||||||
# * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
# * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
||||||
# * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
# * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
# *************************************************************************/
|
# *************************************************************************/
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.0)
|
cmake_minimum_required(VERSION 3.0)
|
||||||
project(SpdlogExamples)
|
project(SpdlogExamples)
|
||||||
|
|
||||||
if(TARGET spdlog)
|
if(TARGET spdlog)
|
||||||
# Part of the main project
|
# Part of the main project
|
||||||
add_library(spdlog::spdlog ALIAS spdlog)
|
add_library(spdlog::spdlog ALIAS spdlog)
|
||||||
else()
|
else()
|
||||||
# Stand-alone build
|
# Stand-alone build
|
||||||
find_package(spdlog CONFIG REQUIRED)
|
find_package(spdlog CONFIG REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(Threads)
|
find_package(Threads)
|
||||||
|
|
||||||
add_executable(example example.cpp)
|
add_executable(example example.cpp)
|
||||||
target_link_libraries(example spdlog::spdlog ${CMAKE_THREAD_LIBS_INIT})
|
target_link_libraries(example spdlog::spdlog ${CMAKE_THREAD_LIBS_INIT})
|
||||||
|
|
||||||
add_executable(benchmark bench.cpp)
|
add_executable(benchmark bench.cpp)
|
||||||
target_link_libraries(benchmark spdlog::spdlog ${CMAKE_THREAD_LIBS_INIT})
|
target_link_libraries(benchmark spdlog::spdlog ${CMAKE_THREAD_LIBS_INIT})
|
||||||
|
|
||||||
enable_testing()
|
enable_testing()
|
||||||
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/logs")
|
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/logs")
|
||||||
add_test(NAME RunExample COMMAND example)
|
add_test(NAME RunExample COMMAND example)
|
||||||
add_test(NAME RunBenchmark COMMAND benchmark)
|
add_test(NAME RunBenchmark COMMAND benchmark)
|
||||||
|
@ -1,29 +1,29 @@
|
|||||||
CXX ?= g++
|
CXX ?= g++
|
||||||
CXXFLAGS =
|
CXXFLAGS =
|
||||||
CXX_FLAGS = -Wall -Wshadow -Wextra -pedantic -std=c++11 -pthread -I../include
|
CXX_FLAGS = -Wall -Wshadow -Wextra -pedantic -std=c++11 -pthread -I../include
|
||||||
CXX_RELEASE_FLAGS = -O3 -march=native
|
CXX_RELEASE_FLAGS = -O3 -march=native
|
||||||
CXX_DEBUG_FLAGS= -g
|
CXX_DEBUG_FLAGS= -g
|
||||||
|
|
||||||
|
|
||||||
all: example bench
|
all: example bench
|
||||||
debug: example-debug bench-debug
|
debug: example-debug bench-debug
|
||||||
|
|
||||||
example: example.cpp
|
example: example.cpp
|
||||||
$(CXX) example.cpp -o example $(CXX_FLAGS) $(CXX_RELEASE_FLAGS) $(CXXFLAGS)
|
$(CXX) example.cpp -o example $(CXX_FLAGS) $(CXX_RELEASE_FLAGS) $(CXXFLAGS)
|
||||||
|
|
||||||
bench: bench.cpp
|
bench: bench.cpp
|
||||||
$(CXX) bench.cpp -o bench $(CXX_FLAGS) $(CXX_RELEASE_FLAGS) $(CXXFLAGS)
|
$(CXX) bench.cpp -o bench $(CXX_FLAGS) $(CXX_RELEASE_FLAGS) $(CXXFLAGS)
|
||||||
|
|
||||||
|
|
||||||
example-debug: example.cpp
|
example-debug: example.cpp
|
||||||
$(CXX) example.cpp -o example-debug $(CXX_FLAGS) $(CXX_DEBUG_FLAGS) $(CXXFLAGS)
|
$(CXX) example.cpp -o example-debug $(CXX_FLAGS) $(CXX_DEBUG_FLAGS) $(CXXFLAGS)
|
||||||
|
|
||||||
bench-debug: bench.cpp
|
bench-debug: bench.cpp
|
||||||
$(CXX) bench.cpp -o bench-debug $(CXX_FLAGS) $(CXX_DEBUG_FLAGS) $(CXXFLAGS)
|
$(CXX) bench.cpp -o bench-debug $(CXX_FLAGS) $(CXX_DEBUG_FLAGS) $(CXXFLAGS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o logs/*.txt example example-debug bench bench-debug
|
rm -f *.o logs/*.txt example example-debug bench bench-debug
|
||||||
|
|
||||||
|
|
||||||
rebuild: clean all
|
rebuild: clean all
|
||||||
rebuild-debug: clean debug
|
rebuild-debug: clean debug
|
||||||
|
@ -1,32 +1,32 @@
|
|||||||
CXX ?= clang++
|
CXX ?= clang++
|
||||||
CXXFLAGS = -march=native -Wall -Wextra -Wshadow -pedantic -std=c++11 -pthread -I../include
|
CXXFLAGS = -march=native -Wall -Wextra -Wshadow -pedantic -std=c++11 -pthread -I../include
|
||||||
CXX_RELEASE_FLAGS = -O2
|
CXX_RELEASE_FLAGS = -O2
|
||||||
CXX_DEBUG_FLAGS= -g
|
CXX_DEBUG_FLAGS= -g
|
||||||
|
|
||||||
|
|
||||||
all: example bench
|
all: example bench
|
||||||
debug: example-debug bench-debug
|
debug: example-debug bench-debug
|
||||||
|
|
||||||
example: example.cpp
|
example: example.cpp
|
||||||
$(CXX) example.cpp -o example-clang $(CXXFLAGS) $(CXX_RELEASE_FLAGS)
|
$(CXX) example.cpp -o example-clang $(CXXFLAGS) $(CXX_RELEASE_FLAGS)
|
||||||
|
|
||||||
bench: bench.cpp
|
bench: bench.cpp
|
||||||
$(CXX) bench.cpp -o bench-clang $(CXXFLAGS) $(CXX_RELEASE_FLAGS)
|
$(CXX) bench.cpp -o bench-clang $(CXXFLAGS) $(CXX_RELEASE_FLAGS)
|
||||||
|
|
||||||
|
|
||||||
example-debug: example.cpp
|
example-debug: example.cpp
|
||||||
$(CXX) example.cpp -o example-clang-debug $(CXXFLAGS) $(CXX_DEBUG_FLAGS)
|
$(CXX) example.cpp -o example-clang-debug $(CXXFLAGS) $(CXX_DEBUG_FLAGS)
|
||||||
|
|
||||||
bench-debug: bench.cpp
|
bench-debug: bench.cpp
|
||||||
$(CXX) bench.cpp -o bench-clang-debug $(CXXFLAGS) $(CXX_DEBUG_FLAGS)
|
$(CXX) bench.cpp -o bench-clang-debug $(CXXFLAGS) $(CXX_DEBUG_FLAGS)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o logs/*.txt example-clang example-clang-debug bench-clang bench-clang-debug
|
rm -f *.o logs/*.txt example-clang example-clang-debug bench-clang bench-clang-debug
|
||||||
|
|
||||||
|
|
||||||
rebuild: clean all
|
rebuild: clean all
|
||||||
rebuild-debug: clean debug
|
rebuild-debug: clean debug
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,32 +1,32 @@
|
|||||||
CXX ?= g++
|
CXX ?= g++
|
||||||
CXXFLAGS = -D_WIN32_WINNT=0x600 -march=native -Wall -Wextra -Wshadow -pedantic -std=c++11 -pthread -Wl,--no-as-needed -I../include
|
CXXFLAGS = -D_WIN32_WINNT=0x600 -march=native -Wall -Wextra -Wshadow -pedantic -std=c++11 -pthread -Wl,--no-as-needed -I../include
|
||||||
CXX_RELEASE_FLAGS = -O3
|
CXX_RELEASE_FLAGS = -O3
|
||||||
CXX_DEBUG_FLAGS= -g
|
CXX_DEBUG_FLAGS= -g
|
||||||
|
|
||||||
|
|
||||||
all: example bench
|
all: example bench
|
||||||
debug: example-debug bench-debug
|
debug: example-debug bench-debug
|
||||||
|
|
||||||
example: example.cpp
|
example: example.cpp
|
||||||
$(CXX) example.cpp -o example $(CXXFLAGS) $(CXX_RELEASE_FLAGS)
|
$(CXX) example.cpp -o example $(CXXFLAGS) $(CXX_RELEASE_FLAGS)
|
||||||
|
|
||||||
bench: bench.cpp
|
bench: bench.cpp
|
||||||
$(CXX) bench.cpp -o bench $(CXXFLAGS) $(CXX_RELEASE_FLAGS)
|
$(CXX) bench.cpp -o bench $(CXXFLAGS) $(CXX_RELEASE_FLAGS)
|
||||||
|
|
||||||
|
|
||||||
example-debug: example.cpp
|
example-debug: example.cpp
|
||||||
$(CXX) example.cpp -o example-debug $(CXXFLAGS) $(CXX_DEBUG_FLAGS)
|
$(CXX) example.cpp -o example-debug $(CXXFLAGS) $(CXX_DEBUG_FLAGS)
|
||||||
|
|
||||||
bench-debug: bench.cpp
|
bench-debug: bench.cpp
|
||||||
$(CXX) bench.cpp -o bench-debug $(CXXFLAGS) $(CXX_DEBUG_FLAGS)
|
$(CXX) bench.cpp -o bench-debug $(CXXFLAGS) $(CXX_DEBUG_FLAGS)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o logs/*.txt example example-debug bench bench-debug
|
rm -f *.o logs/*.txt example example-debug bench bench-debug
|
||||||
|
|
||||||
|
|
||||||
rebuild: clean all
|
rebuild: clean all
|
||||||
rebuild-debug: clean debug
|
rebuild-debug: clean debug
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
*.txt
|
|
||||||
|
|
@ -1,78 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright(c) 2015 Gabi Melman.
|
|
||||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
|
||||||
//
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <spdlog/common.h>
|
|
||||||
#include <spdlog/details/log_msg.h>
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
// Line logger class - aggregates operator<< calls to fast ostream
|
|
||||||
// and logs upon destruction
|
|
||||||
|
|
||||||
namespace spdlog
|
|
||||||
{
|
|
||||||
|
|
||||||
// Forward declaration
|
|
||||||
class logger;
|
|
||||||
|
|
||||||
namespace details
|
|
||||||
{
|
|
||||||
class line_logger
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
line_logger(logger* callback_logger, level::level_enum msg_level, bool enabled);
|
|
||||||
|
|
||||||
// No copy intended. Only move
|
|
||||||
line_logger(const line_logger& other) = delete;
|
|
||||||
line_logger& operator=(const line_logger&) = delete;
|
|
||||||
line_logger& operator=(line_logger&&) = delete;
|
|
||||||
|
|
||||||
|
|
||||||
line_logger(line_logger&& other);
|
|
||||||
|
|
||||||
//Log the log message using the callback logger
|
|
||||||
~line_logger();
|
|
||||||
|
|
||||||
//
|
|
||||||
// Support for format string with variadic args
|
|
||||||
//
|
|
||||||
|
|
||||||
|
|
||||||
void write(const char* what);
|
|
||||||
|
|
||||||
template <typename... Args>
|
|
||||||
void write(const char* fmt, const Args&... args);
|
|
||||||
|
|
||||||
//
|
|
||||||
// Support for operator<<
|
|
||||||
//
|
|
||||||
DEPRECATED line_logger& operator<<(const char* what);
|
|
||||||
DEPRECATED line_logger& operator<<(const std::string& what);
|
|
||||||
DEPRECATED line_logger& operator<<(int what);
|
|
||||||
DEPRECATED line_logger& operator<<(unsigned int what);
|
|
||||||
DEPRECATED line_logger& operator<<(long what);
|
|
||||||
DEPRECATED line_logger& operator<<(unsigned long what);
|
|
||||||
DEPRECATED line_logger& operator<<(long long what);
|
|
||||||
DEPRECATED line_logger& operator<<(unsigned long long what);
|
|
||||||
DEPRECATED line_logger& operator<<(double what);
|
|
||||||
DEPRECATED line_logger& operator<<(long double what);
|
|
||||||
DEPRECATED line_logger& operator<<(float what);
|
|
||||||
DEPRECATED line_logger& operator<<(char what);
|
|
||||||
//Support user types which implements operator<<
|
|
||||||
template<typename T>
|
|
||||||
DEPRECATED line_logger& operator<<(const T& what);
|
|
||||||
|
|
||||||
void disable();
|
|
||||||
bool is_enabled() const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
logger* _callback_logger;
|
|
||||||
log_msg _log_msg;
|
|
||||||
bool _enabled;
|
|
||||||
};
|
|
||||||
} //Namespace details
|
|
||||||
} // Namespace spdlog
|
|
||||||
|
|
@ -1,185 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright(c) 2015 Gabi Melman.
|
|
||||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
|
||||||
//
|
|
||||||
#pragma once
|
|
||||||
#include <type_traits>
|
|
||||||
|
|
||||||
#include <spdlog/details/line_logger_fwd.h>
|
|
||||||
#include <spdlog/common.h>
|
|
||||||
#include <spdlog/logger.h>
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <utility>
|
|
||||||
|
|
||||||
// Line logger class - aggregates operator<< calls to fast ostream
|
|
||||||
// and logs upon destruction
|
|
||||||
|
|
||||||
inline spdlog::details::line_logger::line_logger(logger* callback_logger, level::level_enum msg_level, bool enabled):
|
|
||||||
_callback_logger(callback_logger),
|
|
||||||
_log_msg(msg_level),
|
|
||||||
_enabled(enabled)
|
|
||||||
{}
|
|
||||||
|
|
||||||
inline spdlog::details::line_logger::line_logger(line_logger&& other) :
|
|
||||||
_callback_logger(other._callback_logger),
|
|
||||||
_log_msg(std::move(other._log_msg)),
|
|
||||||
_enabled(other._enabled)
|
|
||||||
{
|
|
||||||
other.disable();
|
|
||||||
}
|
|
||||||
|
|
||||||
//Log the log message using the callback logger
|
|
||||||
inline spdlog::details::line_logger::~line_logger()
|
|
||||||
{
|
|
||||||
if (_enabled)
|
|
||||||
{
|
|
||||||
#ifndef SPDLOG_NO_NAME
|
|
||||||
_log_msg.logger_name = _callback_logger->name();
|
|
||||||
#endif
|
|
||||||
#ifndef SPDLOG_NO_DATETIME
|
|
||||||
_log_msg.time = os::now();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef SPDLOG_NO_THREAD_ID
|
|
||||||
_log_msg.thread_id = os::thread_id();
|
|
||||||
#endif
|
|
||||||
_callback_logger->_log_msg(_log_msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Support for format string with variadic args
|
|
||||||
//
|
|
||||||
|
|
||||||
|
|
||||||
inline void spdlog::details::line_logger::write(const char* what)
|
|
||||||
{
|
|
||||||
if (_enabled)
|
|
||||||
_log_msg.raw << what;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename... Args>
|
|
||||||
inline void spdlog::details::line_logger::write(const char* fmt, const Args&... args)
|
|
||||||
{
|
|
||||||
if (!_enabled)
|
|
||||||
return;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
_log_msg.raw.write(fmt, args...);
|
|
||||||
}
|
|
||||||
catch (const fmt::FormatError& e)
|
|
||||||
{
|
|
||||||
throw spdlog_ex(fmt::format("formatting error while processing format string '{}': {}", fmt, e.what()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// Support for operator<<
|
|
||||||
//
|
|
||||||
inline spdlog::details::line_logger& spdlog::details::line_logger::operator<<(const char* what)
|
|
||||||
{
|
|
||||||
if (_enabled)
|
|
||||||
_log_msg.raw << what;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline spdlog::details::line_logger& spdlog::details::line_logger::operator<<(const std::string& what)
|
|
||||||
{
|
|
||||||
if (_enabled)
|
|
||||||
_log_msg.raw << what;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline spdlog::details::line_logger& spdlog::details::line_logger::operator<<(int what)
|
|
||||||
{
|
|
||||||
if (_enabled)
|
|
||||||
_log_msg.raw << what;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline spdlog::details::line_logger& spdlog::details::line_logger::operator<<(unsigned int what)
|
|
||||||
{
|
|
||||||
if (_enabled)
|
|
||||||
_log_msg.raw << what;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline spdlog::details::line_logger& spdlog::details::line_logger::operator<<(long what)
|
|
||||||
{
|
|
||||||
if (_enabled)
|
|
||||||
_log_msg.raw << what;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline spdlog::details::line_logger& spdlog::details::line_logger::operator<<(unsigned long what)
|
|
||||||
{
|
|
||||||
if (_enabled)
|
|
||||||
_log_msg.raw << what;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline spdlog::details::line_logger& spdlog::details::line_logger::operator<<(long long what)
|
|
||||||
{
|
|
||||||
if (_enabled)
|
|
||||||
_log_msg.raw << what;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline spdlog::details::line_logger& spdlog::details::line_logger::operator<<(unsigned long long what)
|
|
||||||
{
|
|
||||||
if (_enabled)
|
|
||||||
_log_msg.raw << what;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline spdlog::details::line_logger& spdlog::details::line_logger::operator<<(double what)
|
|
||||||
{
|
|
||||||
if (_enabled)
|
|
||||||
_log_msg.raw << what;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline spdlog::details::line_logger& spdlog::details::line_logger::operator<<(long double what)
|
|
||||||
{
|
|
||||||
if (_enabled)
|
|
||||||
_log_msg.raw << what;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline spdlog::details::line_logger& spdlog::details::line_logger::operator<<(float what)
|
|
||||||
{
|
|
||||||
if (_enabled)
|
|
||||||
_log_msg.raw << what;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline spdlog::details::line_logger& spdlog::details::line_logger::operator<<(char what)
|
|
||||||
{
|
|
||||||
if (_enabled)
|
|
||||||
_log_msg.raw << what;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Support user types which implements operator<<
|
|
||||||
template<typename T>
|
|
||||||
inline spdlog::details::line_logger& spdlog::details::line_logger::operator<<(const T& what)
|
|
||||||
{
|
|
||||||
if (_enabled)
|
|
||||||
_log_msg.raw.write("{}", what);
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline void spdlog::details::line_logger::disable()
|
|
||||||
{
|
|
||||||
_enabled = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool spdlog::details::line_logger::is_enabled() const
|
|
||||||
{
|
|
||||||
return _enabled;
|
|
||||||
}
|
|
||||||
|
|
@ -1,19 +1,19 @@
|
|||||||
#
|
#
|
||||||
# Tests
|
# Tests
|
||||||
#
|
#
|
||||||
|
|
||||||
enable_testing()
|
enable_testing()
|
||||||
|
|
||||||
find_package(Threads)
|
find_package(Threads)
|
||||||
|
|
||||||
# Build Catch unit tests
|
# Build Catch unit tests
|
||||||
add_library(catch INTERFACE)
|
add_library(catch INTERFACE)
|
||||||
target_include_directories(catch INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
target_include_directories(catch INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
file(GLOB catch_tests LIST_DIRECTORIES false RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
|
file(GLOB catch_tests LIST_DIRECTORIES false RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
|
||||||
|
|
||||||
add_executable(catch_tests ${catch_tests})
|
add_executable(catch_tests ${catch_tests})
|
||||||
target_link_libraries(catch_tests spdlog ${CMAKE_THREAD_LIBS_INIT})
|
target_link_libraries(catch_tests spdlog ${CMAKE_THREAD_LIBS_INIT})
|
||||||
add_test(NAME catch_tests COMMAND catch_tests)
|
add_test(NAME catch_tests COMMAND catch_tests)
|
||||||
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/logs")
|
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/logs")
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,12 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Install libc++ under travis
|
# Install libc++ under travis
|
||||||
|
|
||||||
svn --quiet co http://llvm.org/svn/llvm-project/libcxx/trunk libcxx
|
svn --quiet co http://llvm.org/svn/llvm-project/libcxx/trunk libcxx
|
||||||
mkdir libcxx/build
|
mkdir libcxx/build
|
||||||
(cd libcxx/build && cmake .. -DLIBCXX_CXX_ABI=libstdc++ -DLIBCXX_CXX_ABI_INCLUDE_PATHS="/usr/include/c++/4.6;/usr/include/c++/4.6/x86_64-linux-gnu")
|
(cd libcxx/build && cmake .. -DLIBCXX_CXX_ABI=libstdc++ -DLIBCXX_CXX_ABI_INCLUDE_PATHS="/usr/include/c++/4.6;/usr/include/c++/4.6/x86_64-linux-gnu")
|
||||||
make -C libcxx/build cxx -j2
|
make -C libcxx/build cxx -j2
|
||||||
sudo cp libcxx/build/lib/libc++.so.1.0 /usr/lib/
|
sudo cp libcxx/build/lib/libc++.so.1.0 /usr/lib/
|
||||||
sudo cp -r libcxx/build/include/c++/v1 /usr/include/c++/v1/
|
sudo cp -r libcxx/build/include/c++/v1 /usr/include/c++/v1/
|
||||||
sudo ln -sf /usr/lib/libc++.so.1.0 /usr/lib/libc++.so
|
sudo ln -sf /usr/lib/libc++.so.1.0 /usr/lib/libc++.so
|
||||||
sudo ln -sf /usr/lib/libc++.so.1.0 /usr/lib/libc++.so.1
|
sudo ln -sf /usr/lib/libc++.so.1.0 /usr/lib/libc++.so.1
|
||||||
|
Loading…
Reference in New Issue