File tree Expand file tree Collapse file tree 6 files changed +13
-13
lines changed Expand file tree Collapse file tree 6 files changed +13
-13
lines changed Original file line number Diff line number Diff line change 11cmake_minimum_required (VERSION 3.26)
22
33include (cmake/PreventInSourceBuilds.cmake)
4+ include (cmake/Features.cmake)
45
56project (
67 Template-CPP
@@ -10,7 +11,6 @@ project(
1011 LANGUAGES CXX
1112)
1213
13- include (cmake/Variables .cmake)
1414include (cmake/CompilerWarnings.cmake)
1515include (cmake/LinkerFlags.cmake)
1616
Original file line number Diff line number Diff line change 11function (set_compiler_warnings target )
2- if (MSVC )
3- if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
2+ if (MSVC )
3+ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
44 set (PROJECT_WARNINGS
55 -Wall
66 -Wextra
@@ -57,7 +57,7 @@ function(set_compiler_warnings target)
5757 /Zc:throwingNew
5858 /EHsc)
5959 endif ()
60- elseif (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
60+ elseif (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
6161 set (PROJECT_WARNINGS
6262 -fstack-protector-strong
6363 -Wall
@@ -80,7 +80,7 @@ function(set_compiler_warnings target)
8080 -Wnon-virtual-dtor
8181 -Wold-style-cast
8282 )
83- elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
83+ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
8484 set (PROJECT_WARNINGS
8585 -U_FORTIFY_SOURCE
8686 -D_FORTIFY_SOURCE=3
Original file line number Diff line number Diff line change 1+ option (FEATURE_TESTS "Enable the tests" OFF )
2+ if (FEATURE_TESTS)
3+ list (APPEND VCPKG_MANIFEST_FEATURES "tests" )
4+ endif ()
5+
6+ if (PROJECT_IS_TOP_LEVEL)
7+ option (BUILD_SHARED_LIBS "Build shared libs." OFF )
8+ endif ()
Original file line number Diff line number Diff line change 1- # ---- In-source guard ----
2-
31if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR )
42 message (
53 FATAL_ERROR
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ set(CMAKE_CATCH_DISCOVER_TESTS_DISCOVERY_MODE PRE_TEST)
77
88add_executable (CoreTests Tests.cpp)
99target_link_libraries (CoreTests PRIVATE Core Catch2::Catch2WithMain)
10- target_compile_features (CoreTests PRIVATE cxx_std_20)
1110
1211# ---- Tests ----
1312
You can’t perform that action at this time.
0 commit comments