mirror of
https://github.com/TheLartians/ModernCppStarter.git
synced 2025-09-03 23:50:53 +02:00
cleanup build files
use strict -std=c++20 update cmake-format config file
This commit is contained in:
parent
1aad14a6fa
commit
7f36b7cb86
12 changed files with 70 additions and 164 deletions
|
@ -41,8 +41,9 @@ CPMAddPackage(
|
|||
file(GLOB sources CONFIGURE_DEPENDS source/*.cpp)
|
||||
add_executable(GreeterTests ${sources})
|
||||
target_link_libraries(GreeterTests doctest::doctest Greeter::Greeter)
|
||||
|
||||
set_target_properties(GreeterTests PROPERTIES CXX_STANDARD 20)
|
||||
# EITHER:
|
||||
set_target_properties(GreeterTests PROPERTIES CXX_STANDARD ${CMAKE_CXX_STANDARD})
|
||||
# OR: target_compile_features(GreeterTests PUBLIC cxx_std_20)
|
||||
|
||||
# enable compiler warnings
|
||||
if(NOT TEST_INSTALLED_VERSION)
|
||||
|
|
|
@ -3,32 +3,15 @@
|
|||
# Ccache.cmake
|
||||
CPMDeclarePackage(
|
||||
Ccache.cmake
|
||||
NAME
|
||||
Ccache.cmake
|
||||
VERSION
|
||||
1.2.1
|
||||
GITHUB_REPOSITORY
|
||||
TheLartians/Ccache.cmake
|
||||
)
|
||||
# doctest
|
||||
CPMDeclarePackage(
|
||||
doctest
|
||||
NAME
|
||||
doctest
|
||||
GIT_TAG
|
||||
2.4.5
|
||||
GITHUB_REPOSITORY
|
||||
onqtam/doctest
|
||||
NAME Ccache.cmake
|
||||
VERSION 1.2.1
|
||||
GITHUB_REPOSITORY TheLartians/Ccache.cmake
|
||||
)
|
||||
# Format.cmake
|
||||
CPMDeclarePackage(
|
||||
Format.cmake
|
||||
NAME
|
||||
Format.cmake
|
||||
VERSION
|
||||
1.6
|
||||
GITHUB_REPOSITORY
|
||||
TheLartians/Format.cmake
|
||||
OPTIONS
|
||||
"FORMAT_CHECK_CMAKE ON"
|
||||
NAME Format.cmake
|
||||
VERSION 1.6
|
||||
GITHUB_REPOSITORY TheLartians/Format.cmake
|
||||
OPTIONS "FORMAT_CHECK_CMAKE ON"
|
||||
)
|
||||
|
|
|
@ -16,7 +16,7 @@ TEST_CASE("Greeter") {
|
|||
}
|
||||
|
||||
TEST_CASE("Greeter version") {
|
||||
#if (__cpp_lib_starts_ends_with)
|
||||
#if ((__cplusplus >= 201907L) || __cpp_lib_starts_ends_with)
|
||||
static_assert(std::string_view(GREETER_VERSION).starts_with("1.0")); // TBD C++20 only
|
||||
CHECK(std::string(GREETER_VERSION).starts_with("1.0")); // SameMajorVersion
|
||||
#else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue