-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
32 lines (27 loc) · 918 Bytes
/
Copy pathCMakeLists.txt
File metadata and controls
32 lines (27 loc) · 918 Bytes
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
cmake_minimum_required(VERSION 3.20)
project(FlightControl LANGUAGES C)
# Use C99 consistently
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
# Optionally enable extra warnings
option(ENABLE_WARNINGS "Enable extra compiler warnings" ON)
if(ENABLE_WARNINGS)
if(CMAKE_C_COMPILER_ID MATCHES "Clang|GNU")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
endif()
# Coverage flags are passed in by CI; keep local builds clean.
# If you want local coverage: cmake -DENABLE_COVERAGE=ON ..
option(ENABLE_COVERAGE "Enable coverage flags for local builds" OFF)
if(ENABLE_COVERAGE)
if(CMAKE_C_COMPILER_ID MATCHES "Clang|GNU")
add_compile_options(--coverage -O0 -g)
add_link_options(--coverage)
endif()
endif()
# Make headers in src/ visible to tests
include_directories(${CMAKE_SOURCE_DIR}/src)
# Enable CTest and add subdirs
enable_testing()
add_subdirectory(src)
add_subdirectory(tests)