This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists_qpc.txt
85 lines (76 loc) · 2.58 KB
/
CMakeLists_qpc.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
# Copyright (C) 2018 Adolfo E. García
#
# This file is part of STG-8nn-Scaffold.
#
# STG-8nn-Scaffold is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# STG-8nn-Scaffold is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with STG-8nn-Scaffold. If not, see <https://www.gnu.org/licenses/>.
##
## dependencies::qpc(qk)
##
cmake_minimum_required(VERSION 3.20)
if(DEFINED SCAFFOLD_DIR)
set(QPC_DIR ${SCAFFOLD_DIR}/dependencies/qpc)
else()
set(QPC_DIR dependencies/qpc)
endif()
# Use uint32_t as the type of the Time Event counter.
add_definitions(-DQF_TIMEEVT_CTR_SIZE=4)
#
# Note: for use with the current ARM Clang toolchain, we're testing CMAKE_ASM_COMPILER_ID instead of
# CMAKE_C_COMPILER_ID (which is reported as Unknown).
#
if("${CMAKE_C_COMPILER_ID}" MATCHES "GNU" AND "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm")
message(STATUS "Building QP/C (qk) for ARM (GNU GCC)")
set(QP_PORT_DIR ports/arm-cm/qk/gnu)
set(QPC_SOURCES
${QPC_DIR}/${QP_PORT_DIR}/qk_port.c
${QPC_DIR}/src/qk/qk.c
)
elseif("${CMAKE_ASM_COMPILER_ID}" MATCHES "Clang" AND "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm")
message(STATUS "Building QP/C (qk) for ARM (Clang)")
set(QP_PORT_DIR ports/arm-cm/qk/armclang)
set(QPC_SOURCES
${QPC_DIR}/${QP_PORT_DIR}/qk_port.c
${QPC_DIR}/src/qk/qk.c
)
else()
# FROM QP/C's DOC:
# "The single-threaded QP/C ports (win32-qv and posix-qv) are recommended for
# emulating software intended for deeply-embedded targets."
message(STATUS "Building QP/C (qutest) for X86")
set(QP_PORT_DIR ports/posix-qv)
set(QPC_SOURCES
${QPC_DIR}/${QP_PORT_DIR}/qep_port.h
${QPC_DIR}/${QP_PORT_DIR}/qf_port.h
${QPC_DIR}/${QP_PORT_DIR}/qf_port.c
)
endif()
set(QPC_INCLUDE
${QPC_DIR}/include
${QPC_DIR}/src
${QPC_DIR}/${QP_PORT_DIR}
)
list(APPEND QPC_SOURCES
${QPC_DIR}/src/qf/qep_hsm.c
${QPC_DIR}/src/qf/qep_msm.c
${QPC_DIR}/src/qf/qf_act.c
${QPC_DIR}/src/qf/qf_actq.c
${QPC_DIR}/src/qf/qf_defer.c
${QPC_DIR}/src/qf/qf_dyn.c
${QPC_DIR}/src/qf/qf_mem.c
${QPC_DIR}/src/qf/qf_ps.c
${QPC_DIR}/src/qf/qf_qact.c
${QPC_DIR}/src/qf/qf_qeq.c
${QPC_DIR}/src/qf/qf_qmact.c
${QPC_DIR}/src/qf/qf_time.c
)