aboutsummaryrefslogtreecommitdiff
path: root/lib/ext/qcbor/CMakeLists.txt
blob: 96f2ec5d7e3dc93f24ec48e48ca4fec6f4a0d06e (plain)
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
#-------------------------------------------------------------------------------
# Copyright (c) 2019-2020, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
#-------------------------------------------------------------------------------

cmake_minimum_required(VERSION 3.7)

#Tell cmake where our modules can be found
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../cmake)

#Some project global settings
set (QCBOR_DIR "${CMAKE_CURRENT_LIST_DIR}")
get_filename_component(TFM_ROOT_DIR "${QCBOR_DIR}/../../.." ABSOLUTE)

#Include common stuff to control cmake.
include("Common/BuildSys")

#Start an embedded project.
embedded_project_start(CONFIG "${TFM_ROOT_DIR}/configs/ConfigDefault.cmake")
project(tfm_qcbor LANGUAGES C)
embedded_project_fixup()

#Append all our source files to global lists.
list(APPEND ALL_SRC_C_ENCODE
	"${QCBOR_DIR}/src/ieee754.c"
	"${QCBOR_DIR}/src/qcbor_encode.c"
	"${QCBOR_DIR}/src/UsefulBuf.c"
	)

#Append all our source files to global lists.
list(APPEND ALL_SRC_C_DECODE
	"${QCBOR_DIR}/src/ieee754.c"
	"${QCBOR_DIR}/src/qcbor_decode.c"
	"${QCBOR_DIR}/src/UsefulBuf.c"
	)

#Append all our source files to global lists.
list(APPEND ALL_SRC_C_TEST
	"${QCBOR_DIR}/test/float_tests.c"
	"${QCBOR_DIR}/test/half_to_double_from_rfc7049.c"
	"${QCBOR_DIR}/test/qcbor_decode_tests.c"
	"${QCBOR_DIR}/test/qcbor_encode_tests.c"
	"${QCBOR_DIR}/test/run_tests.c"
	"${QCBOR_DIR}/test/UsefulBuf_Tests.c"
	)

#Setting include directories
embedded_include_directories(PATH ${QCBOR_DIR}/inc ABSOLUTE)

#Specify what we build (for the QCBOR, build as an object library)
add_library(tfm_qcbor_encode OBJECT ${ALL_SRC_C_ENCODE})
add_library(tfm_qcbor_decode OBJECT ${ALL_SRC_C_DECODE})
add_library(tfm_qcbor_test   OBJECT ${ALL_SRC_C_TEST})

#Set common compiler flags
config_setting_shared_compiler_flags(tfm_qcbor_encode)
config_setting_shared_compiler_flags(tfm_qcbor_decode)
config_setting_shared_compiler_flags(tfm_qcbor_test)

embedded_project_end(tfm_qcbor_encode)
embedded_project_end(tfm_qcbor_decode)
embedded_project_end(tfm_qcbor_test)