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
6fe899af
Commit
6fe899af
authored
May 18, 2019
by
David Zemon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set Threads::Threads dependency on spdlog libs - don't make user do it
parent
107fe0a1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
14 deletions
+19
-14
CMakeLists.txt
CMakeLists.txt
+13
-7
CMakeLists.txt
bench/CMakeLists.txt
+4
-4
CMakeLists.txt
example/CMakeLists.txt
+2
-2
CMakeLists.txt
tests/CMakeLists.txt
+0
-1
No files found.
CMakeLists.txt
View file @
6fe899af
...
...
@@ -56,24 +56,30 @@ set(HEADER_BASE "${CMAKE_CURRENT_SOURCE_DIR}/include/spdlog")
message
(
STATUS
"Build type: "
${
CMAKE_BUILD_TYPE
}
)
find_package
(
Threads REQUIRED
)
# Build library
add_library
(
spdlog src/spdlog.cpp
)
target_compile_definitions
(
spdlog PUBLIC SPDLOG_COMPILED_LIB
)
target_include_directories
(
spdlog PUBLIC
"$<BUILD_INTERFACE:
${
CMAKE_CURRENT_LIST_DIR
}
/include>"
)
set_target_properties
(
spdlog PROPERTIES OUTPUT_NAME
"spdlog"
)
set_target_properties
(
spdlog PROPERTIES DEBUG_POSTFIX
"-debug"
)
target_link_libraries
(
spdlog PUBLIC Threads::Threads
)
# Headr only
# Head
e
r only
add_library
(
spdlog_header_only INTERFACE
)
target_include_directories
(
spdlog_header_only INTERFACE
"$<BUILD_INTERFACE:
${
CMAKE_CURRENT_LIST_DIR
}
/include>"
)
target_include_directories
(
spdlog_header_only INTERFACE
"
${
CMAKE_CURRENT_LIST_DIR
}
/include"
)
target_link_libraries
(
spdlog_header_only INTERFACE Threads::Threads
)
if
(
SPDLOG_FMT_EXTERNAL AND NOT TARGET fmt::fmt
)
find_package
(
fmt REQUIRED CONFIG
)
endif
()
if
(
SPDLOG_FMT_EXTERNAL
)
target_compile_definitions
(
spdlog INTERFACE SPDLOG_FMT_EXTERNAL
)
target_link_libraries
(
spdlog INTERFACE fmt::fmt
)
if
(
NOT TARGET fmt::fmt
)
find_package
(
fmt REQUIRED
)
endif
()
target_compile_definitions
(
spdlog PUBLIC SPDLOG_FMT_EXTERNAL
)
target_link_libraries
(
spdlog PUBLIC fmt::fmt
)
target_compile_definitions
(
spdlog_header_only INTERFACE SPDLOG_FMT_EXTERNAL
)
target_link_libraries
(
spdlog_header_only INTERFACE fmt::fmt
)
endif
()
...
...
bench/CMakeLists.txt
View file @
6fe899af
...
...
@@ -33,16 +33,16 @@ find_package(Threads REQUIRED)
find_package
(
benchmark CONFIG REQUIRED
)
add_executable
(
bench bench.cpp
)
target_link_libraries
(
bench PRIVATE spdlog::spdlog
Threads::Threads
)
target_link_libraries
(
bench PRIVATE spdlog::spdlog
)
add_executable
(
async_bench async_bench.cpp
)
target_link_libraries
(
async_bench PRIVATE spdlog::spdlog
Threads::Threads
)
target_link_libraries
(
async_bench PRIVATE spdlog::spdlog
)
add_executable
(
latency latency.cpp
)
target_link_libraries
(
latency PRIVATE benchmark::benchmark spdlog::spdlog
Threads::Threads
)
target_link_libraries
(
latency PRIVATE benchmark::benchmark spdlog::spdlog
)
add_executable
(
formatter-bench formatter-bench.cpp
)
target_link_libraries
(
formatter-bench PRIVATE benchmark::benchmark spdlog::spdlog
Threads::Threads
)
target_link_libraries
(
formatter-bench PRIVATE benchmark::benchmark spdlog::spdlog
)
file
(
MAKE_DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
/logs"
)
example/CMakeLists.txt
View file @
6fe899af
...
...
@@ -38,7 +38,7 @@ find_package(Threads REQUIRED)
# Example of using pre-compiled library
add_executable
(
example example.cpp
)
target_link_libraries
(
example spdlog::spdlog
Threads::Threads
)
target_link_libraries
(
example spdlog::spdlog
)
if
(
CMAKE_SYSTEM_NAME STREQUAL
"Android"
)
find_library
(
log-lib log
)
target_link_libraries
(
example log
)
...
...
@@ -54,7 +54,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Android")
endif
()
add_executable
(
multisink multisink.cpp
)
target_link_libraries
(
multisink spdlog::spdlog
Threads::Threads
)
target_link_libraries
(
multisink spdlog::spdlog
)
file
(
MAKE_DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
/logs"
)
...
...
tests/CMakeLists.txt
View file @
6fe899af
...
...
@@ -20,7 +20,6 @@ set(SPDLOG_UTESTS_SOURCES
test_fmt_helper.cpp
)
add_executable
(
${
PROJECT_NAME
}
${
SPDLOG_UTESTS_SOURCES
}
)
target_link_libraries
(
${
PROJECT_NAME
}
PRIVATE Threads::Threads
)
target_link_libraries
(
${
PROJECT_NAME
}
PRIVATE spdlog
)
file
(
MAKE_DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
/logs"
)
...
...
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