-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
43 lines (30 loc) · 1.04 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
cmake_minimum_required(VERSION 3.13)
project(reflow-controller)
enable_language(ASM)
add_library(config INTERFACE)
target_compile_features(config INTERFACE cxx_std_20)
target_compile_options(config INTERFACE "-g" "-Wall")
target_include_directories(config INTERFACE "include/")
target_compile_definitions(config INTERFACE UOS_ARCH_$<UPPER_CASE:${CMAKE_SYSTEM_PROCESSOR}>)
# msp430 specific configuration (for main example)
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "msp430")
target_compile_definitions(config INTERFACE
UOS_NUMBER_OF_TASKS=3
UOS_DEV_MSP430_ENABLE_PORT2
UOS_DEV_MSP430_ENABLE_TIMERA0
UOS_DEV_MSP430_ENABLE_EUSCIA1
)
endif()
add_subdirectory(src)
# build tests when not cross compiling
if(NOT ${CMAKE_CROSSCOMPILING})
add_subdirectory(test)
endif()
# git version information
execute_process(
COMMAND git describe --always --dirty
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
OUTPUT_VARIABLE GIT_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
target_compile_definitions(config INTERFACE GIT_VERSION="${GIT_VERSION}")