-
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
51 lines (42 loc) · 2.71 KB
/
Copy pathCMakeLists.txt
File metadata and controls
51 lines (42 loc) · 2.71 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Copyright (c) 2021 Scrutiny Debugger
# License : MIT - See LICENSE file.
# Project : Scrutiny Debugger (github.com/scrutinydebugger/scrutiny-embedded)
cmake_minimum_required(VERSION 3.14)
project(scrutiny-embedded)
macro(SCRUTINY_OPTION name default_value type docstring)
if(NOT DEFINED ${name})
set(${name} ${default_value} CACHE ${type} ${docstring})
else()
set(${name} ${${name}} CACHE ${type} ${docstring} FORCE)
endif()
message(STATUS "Scrutiny option: ${name}=${${name}}")
endmacro()
SCRUTINY_OPTION(SCRUTINY_BUILD_TEST OFF BOOL "Activate test suite")
SCRUTINY_OPTION(SCRUTINY_ENABLE_DATALOGGING ON BOOL "Enable datalogging feature")
SCRUTINY_OPTION(SCRUTINY_SUPPORT_64BITS ON BOOL "Enable support for 64bits variables")
SCRUTINY_OPTION(SCRUTINY_SUPPORT_PROTECTED_REGIONS ON BOOL "Allow setting read-only and forbidden regions")
SCRUTINY_OPTION(SCRUTINY_BUILD_CWRAPPER ON BOOL "Build a C99 wrapper")
SCRUTINY_OPTION(SCRUTINY_DATALOGGING_BUFFER_32BITS OFF BOOL "Allow datalogging buffers bigger than 65536 bytes")
SCRUTINY_OPTION(SCRUTINY_USE_ASAN OFF BOOL "Build Scrutiny with Address Sanitizer (for unit testing)")
SCRUTINY_OPTION(SCRUTINY_DATALOGGING_MAX_SIGNAL 16 STRING "Maximum number of datalogging signal if datalogging is enabled")
SCRUTINY_OPTION(SCRUTINY_REQUEST_MAX_PROCESS_TIME_US 100000 STRING "Maximum time allowed to process a request (us)")
SCRUTINY_OPTION(SCRUTINY_COMM_RX_TIMEOUT_US 50000 STRING "Maximum time between reception of 2 consecutive byte (us)")
SCRUTINY_OPTION(SCRUTINY_COMM_HEARTBEAT_TIMEOUT_US 5000000 STRING "Maximum time without communication before closing the session (us)")
SCRUTINY_OPTION(SCRUTINY_PROTOCOL_VERSION_MAJOR 1 STRING "Protocol version major number")
SCRUTINY_OPTION(SCRUTINY_PROTOCOL_VERSION_MINOR 0 STRING "Protocol version minor")
SCRUTINY_OPTION(SCRUTINY_DATALOGGING_ENCODING SCRUTINY_DATALOGGING_ENCODING_RAW STRING "Datalogging encoding scheme")
SCRUTINY_OPTION(INSTALL_FOLDER ${CMAKE_CURRENT_BINARY_DIR}/install STRING "Install folder" )
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if (SCRUTINY_USE_ASAN)
add_compile_options(-fsanitize=address)
string(APPEND CMAKE_EXE_LINKER_FLAGS " -fsanitize=address")
endif()
add_subdirectory(lib)
include(lib/cmake/scrutiny.cmake) # Make available for project importing us with FetchContent
if (SCRUTINY_BUILD_CWRAPPER)
add_subdirectory(cwrapper)
endif()
add_subdirectory(projects)
if (SCRUTINY_BUILD_TEST)
add_subdirectory(test)
endif()