forked from nasa/fprime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
44 lines (40 loc) · 1.5 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
####
# CMakeLists.txt:
#
# Build core F prime.
####
cmake_minimum_required(VERSION 3.16)
project(FPrime C CXX)
set(FPRIME_FRAMEWORK_PATH "${CMAKE_CURRENT_LIST_DIR}" CACHE PATH "Location of F prime framework" FORCE)
set(FPRIME_PROJECT_ROOT "${CMAKE_CURRENT_LIST_DIR}" CACHE PATH "Root path of F prime project" FORCE)
# Include the build for F prime.
include("${CMAKE_CURRENT_LIST_DIR}/cmake/FPrime.cmake")
# Set default warning flags for all builds
# Specific build modules that do not comply with these flags can disable one or more of them
#
# -Wno-unused-parameter: Disable the unused parameter warning for now. F' has a lot of interfaces,
# so unused method parameters are common in the F prime code base. Eventually all intentionally
# unused parameters should be annotated to avoid this error.
#
# -Wno-vla: Variable length arrays are required to support sending to async serializable
# ports. https://github.com/nasa/fprime/issues/945
#
add_compile_options(
$<$<COMPILE_LANGUAGE:CXX>:-Wold-style-cast>
-Wall
-Wconversion
-Wdouble-promotion
-Werror
-Wextra
-Wno-unused-parameter
-Wno-vla
-Wshadow
-pedantic
)
find_program(VALGRIND valgrind) # Find valgrind, and use it instead of leak check
# Enable sanitizers
if (BUILD_TESTING AND NOT VALGRIND)
add_compile_options(-fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined)
add_link_options(-fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined)
endif()
include("${CMAKE_CURRENT_LIST_DIR}/cmake/FPrime-Code.cmake")