forked from nasa/fprime
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.cmake
More file actions
34 lines (31 loc) · 1.22 KB
/
settings.cmake
File metadata and controls
34 lines (31 loc) · 1.22 KB
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
####
# settings.cmake:
#
# Required build settings for building against the fprime framework. This list **should** be kept small, only setting
# items that are strictly required for building fprime. Settings must be restricted to items that are required to ensure
# fprime builds properly.
#
# Required settings:
# - C standard 99
# - C++ 11 standard, fprime uses C++11 items
# - UT flags overrides
####
include_guard()
# fprime framework is build with C++11 and C99 support, project may override these setting after the inclusion of
# Fprime-Code.cmake.
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)
# fprime unit testing methodology requires the following flags
if (BUILD_TESTING)
add_compile_options(-DBUILD_UT -DPROTECTED=public -DPRIVATE=public -DSTATIC=)
# By default when CMake testing is enabled `CMAKE_BUILD_TYPE` is set to "Debug".
# If, in a deployment's top-level CMakeLists.txt, `CMAKE_BUILD_TYPE` is explicitly set to
# "Release" this should be respected and the debug flag should be omitted
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_options(-g)
endif()
endif()