-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
68 lines (51 loc) · 1.36 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
cmake_minimum_required(VERSION 3.12)
project(stm32-eth VERSION 0.9.5)
message(STATUS "~~~ ${PROJECT_NAME} v${PROJECT_VERSION} ~~~")
message(STATUS "Target: ${CMAKE_SYSTEM_PROCESSOR} (${CMAKE_SYSTEM_NAME})")
message(STATUS "Build Type : ${CMAKE_BUILD_TYPE}")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
include(CMakeParseArguments)
include(Options)
include(BuildType)
include(CompilerOptions)
include(UtilityTargets)
include(ClangFormat)
include(Sanitizer)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
add_common_flags(-Wall
-Wextra
-pedantic
-pedantic-errors
-Werror
-Wshadow
)
add_cpp_flags(-Wold-style-cast
-Wnull-dereference
-Wnon-virtual-dtor
-Woverloaded-virtual
)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0)
message(STATUS "GCC < 10.0 doesn't support Concepts with C++20, fall back to '-fconcepts'")
add_cpp_flags(-fconcepts)
endif()
if( COVERAGE )
include(Coverage)
endif()
if( LTO )
include(LTO)
endif()
if( CMAKE_CROSSCOMPILING )
set(CMAKE_EXECUTABLE_SUFFIX ".elf")
endif()
add_subdirectory("system")
include_directories("include")
add_subdirectory("src")
if( UNITTEST )
enable_testing()
add_subdirectory("test")
endif()
if( INTEGRATIONTEST )
add_subdirectory("test/integration")
endif()