mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-28 17:19:34 +08:00
CMake improvements
This commit is contained in:
@@ -15,10 +15,19 @@ set(SPDLOG_UTESTS_SOURCES
|
||||
test_sink.h
|
||||
test_fmt_helper.cpp)
|
||||
|
||||
add_executable(spdlog-utests ${SPDLOG_UTESTS_SOURCES})
|
||||
target_link_libraries(spdlog-utests spdlog)
|
||||
|
||||
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/logs")
|
||||
|
||||
enable_testing()
|
||||
add_test(NAME spdlog-utests COMMAND spdlog-utests)
|
||||
|
||||
# The compiled library tests
|
||||
if(SPDLOG_BUILD_TESTS)
|
||||
add_executable(spdlog-utests ${SPDLOG_UTESTS_SOURCES})
|
||||
target_link_libraries(spdlog-utests spdlog)
|
||||
add_test(NAME spdlog-utests COMMAND spdlog-utests)
|
||||
endif()
|
||||
|
||||
# The header-only library version tests
|
||||
if(SPDLOG_BUILD_HO_TESTS)
|
||||
add_executable(spdlog-utests-ho ${SPDLOG_UTESTS_SOURCES})
|
||||
target_link_libraries(spdlog-utests-ho spdlog::spdlog_header_only)
|
||||
add_test(NAME spdlog-utests-ho COMMAND spdlog-utests-ho)
|
||||
endif()
|
Reference in New Issue
Block a user