Skip to content

Commit fb16c2b

Browse files
committed
minimal changes
1 parent 3f1ac11 commit fb16c2b

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
cmake_minimum_required(VERSION 3.26)
22

33
include(cmake/PreventInSourceBuilds.cmake)
4+
include(cmake/Features.cmake)
45

56
project(
67
Template-CPP
@@ -10,7 +11,6 @@ project(
1011
LANGUAGES CXX
1112
)
1213

13-
include(cmake/Variables.cmake)
1414
include(cmake/CompilerWarnings.cmake)
1515
include(cmake/LinkerFlags.cmake)
1616

cmake/CompilerWarnings.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function(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

cmake/Features.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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()

cmake/PreventInSourceBuilds.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# ---- In-source guard ----
2-
31
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
42
message(
53
FATAL_ERROR

cmake/Variables.cmake

Lines changed: 0 additions & 5 deletions
This file was deleted.

library/test/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ set(CMAKE_CATCH_DISCOVER_TESTS_DISCOVERY_MODE PRE_TEST)
77

88
add_executable(CoreTests Tests.cpp)
99
target_link_libraries(CoreTests PRIVATE Core Catch2::Catch2WithMain)
10-
target_compile_features(CoreTests PRIVATE cxx_std_20)
1110

1211
# ---- Tests ----
1312

0 commit comments

Comments
 (0)