mirror of
https://github.com/TheLartians/ModernCppStarter.git
synced 2025-09-04 08:00:53 +02:00
reverted usage of to Greeter and ran fix-format
This commit is contained in:
parent
004f33fde1
commit
a377b27597
4 changed files with 12 additions and 11 deletions
|
@ -19,9 +19,9 @@ CPMAddPackage("gh:onqtam/doctest#2.4.5")
|
|||
CPMAddPackage("gh:TheLartians/Format.cmake@1.7.0")
|
||||
|
||||
if(TEST_INSTALLED_VERSION)
|
||||
find_package(${CMAKE_PROJECT_NAME} REQUIRED)
|
||||
find_package(Greeter REQUIRED)
|
||||
else()
|
||||
CPMAddPackage(NAME ${CMAKE_PROJECT_NAME} SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/..)
|
||||
CPMAddPackage(NAME Greeter SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/..)
|
||||
endif()
|
||||
|
||||
# ---- Create binary ----
|
||||
|
@ -34,9 +34,9 @@ set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 17)
|
|||
# enable compiler warnings
|
||||
if(NOT TEST_INSTALLED_VERSION)
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
target_compile_options(${CMAKE_PROJECT_NAME} PUBLIC -Wall -Wpedantic -Wextra -Werror)
|
||||
target_compile_options(Greeter PUBLIC -Wall -Wpedantic -Wextra -Werror)
|
||||
elseif(MSVC)
|
||||
target_compile_options(${CMAKE_PROJECT_NAME} PUBLIC /W4 /WX)
|
||||
target_compile_options(Greeter PUBLIC /W4 /WX)
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC DOCTEST_CONFIG_USE_STD_HEADERS)
|
||||
endif()
|
||||
endif()
|
||||
|
@ -46,7 +46,8 @@ endif()
|
|||
enable_testing()
|
||||
|
||||
# Note: doctest and similar testing frameworks can automatically configure CMake tests. For other
|
||||
# testing frameworks add the tests target instead: add_test(NAME ${PROJECT_NAME} COMMAND GreeterTests)
|
||||
# testing frameworks add the tests target instead: add_test(NAME ${PROJECT_NAME} COMMAND
|
||||
# GreeterTests)
|
||||
|
||||
include(${doctest_SOURCE_DIR}/scripts/cmake/doctest.cmake)
|
||||
doctest_discover_tests(${PROJECT_NAME})
|
||||
|
@ -54,6 +55,6 @@ doctest_discover_tests(${PROJECT_NAME})
|
|||
# ---- code coverage ----
|
||||
|
||||
if(ENABLE_TEST_COVERAGE)
|
||||
target_compile_options(${CMAKE_PROJECT_NAME} PUBLIC -O0 -g -fprofile-arcs -ftest-coverage)
|
||||
target_link_options(${CMAKE_PROJECT_NAME} PUBLIC -fprofile-arcs -ftest-coverage)
|
||||
target_compile_options(Greeter PUBLIC -O0 -g -fprofile-arcs -ftest-coverage)
|
||||
target_link_options(Greeter PUBLIC -fprofile-arcs -ftest-coverage)
|
||||
endif()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue