-
Notifications
You must be signed in to change notification settings - Fork 224
/
Copy pathCMakeLists.txt
110 lines (100 loc) · 3.56 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
######################################################################
#
# CMAKE recipe for the OSAL stub library
#
######################################################################
#
# This works in conjunction with the UT Assert library to
# provide "stub" versions of all calls in the OSAL public API.
#
set(OSAL_PUBLIC_API_HEADERS
${OSAL_SOURCE_DIR}/src/os/inc/osapi-binsem.h
${OSAL_SOURCE_DIR}/src/os/inc/osapi-bsp.h
${OSAL_SOURCE_DIR}/src/os/inc/osapi-clock.h
${OSAL_SOURCE_DIR}/src/os/inc/osapi-common.h
${OSAL_SOURCE_DIR}/src/os/inc/osapi-constants.h
${OSAL_SOURCE_DIR}/src/os/inc/osapi-countsem.h
${OSAL_SOURCE_DIR}/src/os/inc/osapi-dir.h
${OSAL_SOURCE_DIR}/src/os/inc/osapi-error.h
${OSAL_SOURCE_DIR}/src/os/inc/osapi-file.h
${OSAL_SOURCE_DIR}/src/os/inc/osapi-filesys.h
${OSAL_SOURCE_DIR}/src/os/inc/osapi-heap.h
${OSAL_SOURCE_DIR}/src/os/inc/osapi-idmap.h
${OSAL_SOURCE_DIR}/src/os/inc/osapi-macros.h
${OSAL_SOURCE_DIR}/src/os/inc/osapi-module.h
${OSAL_SOURCE_DIR}/src/os/inc/osapi-mutex.h
${OSAL_SOURCE_DIR}/src/os/inc/osapi-network.h
${OSAL_SOURCE_DIR}/src/os/inc/osapi-printf.h
${OSAL_SOURCE_DIR}/src/os/inc/osapi-queue.h
${OSAL_SOURCE_DIR}/src/os/inc/osapi-select.h
${OSAL_SOURCE_DIR}/src/os/inc/osapi-shell.h
${OSAL_SOURCE_DIR}/src/os/inc/osapi-sockets.h
${OSAL_SOURCE_DIR}/src/os/inc/osapi-task.h
${OSAL_SOURCE_DIR}/src/os/inc/osapi-timebase.h
${OSAL_SOURCE_DIR}/src/os/inc/osapi-timer.h
${OSAL_SOURCE_DIR}/src/os/inc/osapi-version.h
)
# The following target rule contains the specific commands required
# to auto-generate the stub implementations from the headers
add_custom_target(generate_osapi_stubs
COMMAND ${UT_ASSERT_SOURCE_DIR}/scripts/generate_stubs.pl
${CMAKE_CURRENT_SOURCE_DIR}
${OSAL_PUBLIC_API_HEADERS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
VERBATIM
)
# NOTE: There is no separate public include directory for the stubs.
# By definition, the stubs must implement the same public API that the
# normal OSAL library implements. Therefore, only the standard OSAL
# header files are used.
add_library(ut_osapi_stubs STATIC
utstub-helpers.c
osapi-binsem-stubs.c
osapi-binsem-handlers.c
osapi-clock-stubs.c
osapi-clock-handlers.c
osapi-common-stubs.c
osapi-countsem-stubs.c
osapi-countsem-handlers.c
osapi-dir-stubs.c
osapi-dir-handlers.c
osapi-error-stubs.c
osapi-error-handlers.c
osapi-file-stubs.c
osapi-file-handlers.c
osapi-filesys-stubs.c
osapi-filesys-handlers.c
osapi-heap-stubs.c
osapi-heap-handlers.c
osapi-idmap-stubs.c
osapi-idmap-handlers.c
osapi-module-stubs.c
osapi-module-handlers.c
osapi-mutex-stubs.c
osapi-mutex-handlers.c
osapi-network-stubs.c
osapi-network-handlers.c
osapi-printf-stubs.c
osapi-printf-handlers.c
osapi-queue-stubs.c
osapi-queue-handlers.c
osapi-select-stubs.c
osapi-sockets-stubs.c
osapi-sockets-handlers.c
osapi-task-stubs.c
osapi-task-handlers.c
osapi-timer-stubs.c
osapi-timer-handlers.c
osapi-timebase-stubs.c
osapi-timebase-handlers.c
osapi-version-stubs.c
osapi-version-handlers.c
)
# Some of the internal API definitions in stubs are based on
# types/definitions in the shared layer internal header file.
target_include_directories(ut_osapi_stubs PRIVATE
${OSAL_SOURCE_DIR}/src/os/shared/inc
)
# These stubs must always link to UT Assert.
# This also implicitly adds the path to the UT Assert header files.
target_link_libraries(ut_osapi_stubs ut_assert)