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
d1dadc98
Unverified
Commit
d1dadc98
authored
Oct 25, 2019
by
Gabi Melman
Committed by
GitHub
Oct 25, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1283 from bencsikandrei/refactor/cmake-minor-duplication-removal
Minor cmake code duplication improvement
parents
4858d7e4
2cc620ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
19 deletions
+13
-19
tests/CMakeLists.txt
tests/CMakeLists.txt
+13
-19
No files found.
tests/CMakeLists.txt
View file @
d1dadc98
...
...
@@ -38,31 +38,25 @@ endif()
file
(
MAKE_DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
/logs"
)
enable_testing
()
# The compiled library tests
if
(
SPDLOG_BUILD_TESTS
)
add_executable
(
spdlog-utests
${
SPDLOG_UTESTS_SOURCES
}
)
spdlog_enable_warnings
(
spdlog-utests
)
target_link_libraries
(
spdlog-utests PRIVATE spdlog
)
function
(
spdlog_prepare_test test_target spdlog_lib
)
add_executable
(
${
test_target
}
${
SPDLOG_UTESTS_SOURCES
}
)
spdlog_enable_warnings
(
${
test_target
}
)
target_link_libraries
(
${
test_target
}
PRIVATE
${
spdlog_lib
}
)
if
(
systemd_FOUND
)
target_link_libraries
(
spdlog-utests
PRIVATE
${
systemd_LIBRARIES
}
)
target_link_libraries
(
${
test_target
}
PRIVATE
${
systemd_LIBRARIES
}
)
endif
()
if
(
SPDLOG_SANITIZE_ADDRESS
)
spdlog_enable_sanitizer
(
spdlog-utests
)
spdlog_enable_sanitizer
(
${
test_target
}
)
endif
()
add_test
(
NAME spdlog-utests COMMAND spdlog-utests
)
add_test
(
NAME
${
test_target
}
COMMAND
${
test_target
}
)
endfunction
()
# The compiled library tests
if
(
SPDLOG_BUILD_TESTS
)
spdlog_prepare_test
(
spdlog-utests spdlog::spdlog
)
endif
()
# The header-only library version 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
)
if
(
systemd_FOUND
)
target_link_libraries
(
spdlog-utests-ho PRIVATE
${
systemd_LIBRARIES
}
)
endif
()
if
(
SPDLOG_SANITIZE_ADDRESS
)
spdlog_set_address_sanitizer
(
spdlog-utests-ho
)
endif
()
add_test
(
NAME spdlog-utests-ho COMMAND spdlog-utests-ho
)
spdlog_prepare_test
(
spdlog-utests-ho spdlog::spdlog_header_only
)
endif
()
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