Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
spdlog
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
spdlog
Commits
bb0f3839
Commit
bb0f3839
authored
Jul 01, 2019
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated CMake options and defaults
parent
f09334dc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
11 deletions
+25
-11
CMakeLists.txt
CMakeLists.txt
+17
-7
example/CMakeLists.txt
example/CMakeLists.txt
+5
-3
tests/CMakeLists.txt
tests/CMakeLists.txt
+3
-1
No files found.
CMakeLists.txt
View file @
bb0f3839
...
...
@@ -40,18 +40,28 @@ if (NOT DEFINED SPDLOG_MASTER_PROJECT)
endif
()
endif
()
option
(
SPDLOG_BUILD_EXAMPLES
"Build examples"
OFF
)
# example options
option
(
SPDLOG_BUILD_EXAMPLE
"Build example"
${
SPDLOG_MASTER_PROJECT
}
)
option
(
SPDLOG_BUILD_EXAMPLE_HO
"Build header only example"
OFF
)
# testing options
option
(
SPDLOG_BUILD_TESTS
"Build tests"
${
SPDLOG_MASTER_PROJECT
}
)
option
(
SPDLOG_BUILD_TESTS_HO
"Build tests using the header only version"
OFF
)
# bench options
option
(
SPDLOG_BUILD_BENCH
"Build benchmarks (Requires https://github.com/google/benchmark.git to be installed)"
OFF
)
option
(
SPDLOG_BUILD_TESTS
"Build tests"
OFF
)
option
(
SPDLOG_BUILD_HO_TESTS
"Build tests using the header only version"
OFF
)
# sanitizer options
option
(
SPDLOG_SANITIZE_ADDRESS
"Enable address sanitizer in tests"
OFF
)
# install options
option
(
SPDLOG_INSTALL
"Generate the install target."
${
SPDLOG_MASTER_PROJECT
}
)
option
(
SPDLOG_FMT_EXTERNAL
"Use external fmt library instead of bundled"
OFF
)
message
(
STATUS
"Build type: "
${
CMAKE_BUILD_TYPE
}
)
find_package
(
Threads REQUIRED
)
message
(
STATUS
"Build type: "
${
CMAKE_BUILD_TYPE
}
)
#---------------------------------------------------------------------------------------
# Static/Shared library (shared not supported in windows yet)
#---------------------------------------------------------------------------------------
...
...
@@ -101,12 +111,12 @@ endif()
#---------------------------------------------------------------------------------------
# Build binaries
#---------------------------------------------------------------------------------------
if
(
SPDLOG_BUILD_EXAMPLE
S
)
if
(
SPDLOG_BUILD_EXAMPLE
OR SPDLOG_BUILD_EXAMPLE_HO
)
message
(
STATUS
"Generating examples"
)
add_subdirectory
(
example
)
endif
()
if
(
SPDLOG_BUILD_TESTS
)
if
(
SPDLOG_BUILD_TESTS
OR SPDLOG_BUILD_TESTS_HO
)
message
(
STATUS
"Generating tests"
)
include
(
CTest
)
add_subdirectory
(
tests
)
...
...
example/CMakeLists.txt
View file @
bb0f3839
...
...
@@ -19,9 +19,11 @@ target_link_libraries(example PRIVATE spdlog::spdlog)
#---------------------------------------------------------------------------------------
# Example of using header-only library
#---------------------------------------------------------------------------------------
add_executable
(
example_header_only example.cpp
)
spdlog_enable_warnings
(
example_header_only
)
target_link_libraries
(
example_header_only PRIVATE spdlog::spdlog_header_only
)
if
(
SPDLOG_BUILD_EXAMPLE_HO
)
add_executable
(
example_header_only example.cpp
)
spdlog_enable_warnings
(
example_header_only
)
target_link_libraries
(
example_header_only PRIVATE spdlog::spdlog_header_only
)
endif
()
# Create logs directory
file
(
MAKE_DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
/logs"
)
tests/CMakeLists.txt
View file @
bb0f3839
project
(
spdlog_utests CXX
)
find_package
(
PkgConfig
)
if
(
PkgConfig_FOUND
)
pkg_check_modules
(
systemd libsystemd
)
...
...
@@ -45,7 +47,7 @@ if(SPDLOG_BUILD_TESTS)
endif
()
# The header-only library version tests
if
(
SPDLOG_BUILD_
HO_TESTS
)
if
(
SPDLOG_BUILD_
TESTS_HO
)
add_executable
(
spdlog-utests-ho
${
SPDLOG_UTESTS_SOURCES
}
)
spdlog_enable_warnings
(
spdlog-utests-ho
)
target_link_libraries
(
spdlog-utests-ho PRIVATE spdlog::spdlog_header_only
)
...
...
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