Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
spdlog
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
spdlog
Commits
da30e2ef
Commit
da30e2ef
authored
Aug 12, 2018
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved CMakeLists and added bench
parent
cb299375
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
4 deletions
+68
-4
.travis.yml
.travis.yml
+1
-1
CMakeLists.txt
CMakeLists.txt
+23
-2
CMakeLists.txt
bench/CMakeLists.txt
+44
-0
CMakeLists.txt
example/CMakeLists.txt
+0
-1
No files found.
.travis.yml
View file @
da30e2ef
...
...
@@ -93,7 +93,7 @@ install:
-DCMAKE_CXX_STANDARD=$CPP \
-DSPDLOG_BUILD_EXAMPLES=ON \
-DSPDLOG_SANITIZE_ADDRESS=$ASAN
-
VERBOSE=1 make
-j2
-
make VERBOSE=1
-j2
script
:
-
if [ "$ASAN" != "On" ]; then CTEST_FLAGS="-DExperimentalMemCheck"; fi
...
...
CMakeLists.txt
View file @
da30e2ef
...
...
@@ -9,6 +9,17 @@ include(CTest)
include
(
CMakeDependentOption
)
include
(
GNUInstallDirs
)
#---------------------------------------------------------------------------------------
# set default build to release
#---------------------------------------------------------------------------------------
if
(
NOT CMAKE_BUILD_TYPE
)
set
(
CMAKE_BUILD_TYPE
"Release"
CACHE STRING
"Choose Release or Debug"
FORCE
)
endif
()
message
(
"Build type: "
${
CMAKE_BUILD_TYPE
}
)
#---------------------------------------------------------------------------------------
# compiler config
#---------------------------------------------------------------------------------------
...
...
@@ -17,9 +28,13 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set
(
CMAKE_CXX_EXTENSIONS OFF
)
if
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"GNU"
OR
"
${
CMAKE_CXX_COMPILER_ID
}
"
MATCHES
"Clang"
)
set
(
CMAKE_CXX_FLAGS
"-Wall -
O3
${
CMAKE_CXX_FLAGS
}
"
)
set
(
CMAKE_CXX_FLAGS
"-Wall -
Wextra
${
CMAKE_CXX_FLAGS
}
"
)
endif
()
#---------------------------------------------------------------------------------------
# address sanitizers check
#---------------------------------------------------------------------------------------
include
(
cmake/sanitizers.cmake
)
#---------------------------------------------------------------------------------------
...
...
@@ -28,7 +43,9 @@ include(cmake/sanitizers.cmake)
add_library
(
spdlog INTERFACE
)
add_library
(
spdlog::spdlog ALIAS spdlog
)
option
(
SPDLOG_BUILD_EXAMPLES
"Build examples"
OFF
)
option
(
SPDLOG_BUILD_EXAMPLES
"Build examples"
ON
)
option
(
SPDLOG_BUILD_BENCH
"Build benchmarks"
ON
)
cmake_dependent_option
(
SPDLOG_BUILD_TESTING
"Build spdlog tests"
ON
"BUILD_TESTING"
OFF
...
...
@@ -51,6 +68,10 @@ if(SPDLOG_BUILD_TESTING)
add_subdirectory
(
tests
)
endif
()
if
(
SPDLOG_BUILD_BENCH
)
add_subdirectory
(
bench
)
endif
()
#---------------------------------------------------------------------------------------
# Install/export targets and files
#---------------------------------------------------------------------------------------
...
...
bench/CMakeLists.txt
0 → 100644
View file @
da30e2ef
# *************************************************************************/
# * Copyright (c) 2015 Ruslan Baratov. */
# * */
# * Permission is hereby granted, free of charge, to any person obtaining */
# * a copy of this software and associated documentation files (the */
# * "Software"), to deal in the Software without restriction, including */
# * without limitation the rights to use, copy, modify, merge, publish, */
# * distribute, sublicense, and/or sell copies of the Software, and to */
# * permit persons to whom the Software is furnished to do so, subject to */
# * the following conditions: */
# * */
# * The above copyright notice and this permission notice shall be */
# * included in all copies or substantial portions of the Software. */
# * */
# * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
# * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
# * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
# * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
# * CLAIM, DAMAGES OR OTHER 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 THE SOFTWARE. */
# *************************************************************************/
cmake_minimum_required
(
VERSION 3.1
)
project
(
SpdlogBench CXX
)
if
(
NOT TARGET spdlog
)
# Stand-alone build
find_package
(
spdlog CONFIG REQUIRED
)
endif
()
find_package
(
Threads REQUIRED
)
add_executable
(
bench bench.cpp
)
target_link_libraries
(
bench spdlog::spdlog Threads::Threads
)
add_executable
(
async_bench async_bench.cpp
)
target_link_libraries
(
async_bench spdlog::spdlog Threads::Threads
)
add_executable
(
latency latency.cpp
)
target_link_libraries
(
latency spdlog::spdlog Threads::Threads
)
file
(
MAKE_DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
/logs"
)
example/CMakeLists.txt
View file @
da30e2ef
...
...
@@ -40,4 +40,3 @@ target_link_libraries(multisink spdlog::spdlog Threads::Threads)
enable_testing
()
file
(
MAKE_DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
/logs"
)
add_test
(
NAME example COMMAND example
)
add_test
(
NAME multisink COMMAND multisink
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment