ssflib: Fixes to Transient Object (de)allocation
[platform/core/security/tef-simulator.git] / CMakeLists.txt
1 # Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
2 #
3 #    Licensed under the Apache License, Version 2.0 (the "License");
4 #    you may not use this file except in compliance with the License.
5 #    You may obtain a copy of the License at
6 #
7 #        http://www.apache.org/licenses/LICENSE-2.0
8 #
9 #    Unless required by applicable law or agreed to in writing, software
10 #    distributed under the License is distributed on an "AS IS" BASIS,
11 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 #    See the License for the specific language governing permissions and
13 #    limitations under the License.
14 #
15 # @file
16 # @author  Lukasz Kostyra (l.kostyra@samsung.com)
17 # @brief   Main CMakeLists for tef-simulator
18 #
19
20 ############################# Check minimum CMake version #####################
21
22 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
23 PROJECT("tef-simulator")
24
25 ############################# cmake packages ##################################
26
27 INCLUDE(FindPkgConfig)
28
29 ############################# compiler flags ##################################
30
31 # If supported for the target machine, emit position-independent code,suitable
32 # for dynamic linking and avoiding any limit on the size of the global offset
33 # table. This option makes a difference on the m68k, PowerPC and SPARC.
34 ADD_DEFINITIONS("-fPIC")
35
36 # SECOS SIM define used in the project
37 ADD_DEFINITIONS("-D_SECOS_SIM_")
38
39 # Disable std::array in boost - daemon is built around boost's implementation of array
40 ADD_DEFINITIONS("-DBOOST_ASIO_DISABLE_STD_ARRAY")
41
42 ADD_DEFINITIONS("-D_GNU_SOURCE")
43
44 # Set compiler warning flags
45 # TODO uncomment these when it's cleanup time
46 #ADD_DEFINITIONS("-Werror")                      # Make all warnings into errors.
47 #ADD_DEFINITIONS("-Wall")                        # Generate all warnings
48 #ADD_DEFINITIONS("-Wextra")                      # Generate even more extra warnings
49
50
51 IF (CMAKE_BUILD_TYPE MATCHES "DEBUG")
52     ADD_DEFINITIONS("-DTIZEN_DEBUG_ENABLE")
53     ADD_DEFINITIONS("-DBUILD_TYPE_DEBUG")
54     ADD_DEFINITIONS("-ggdb -O0")
55     # undefine _FORTIFY_SOURCE to supress warnings
56     ADD_COMPILE_OPTIONS("-U_FORTIFY_SOURCE")
57 ENDIF (CMAKE_BUILD_TYPE MATCHES "DEBUG")
58
59 ############################# targets #########################################
60
61 SET(TARGET_TEF_SIMULATOR tef-simulator)
62 SET(TARGET_TEF_SIMULATOR_LOG ${TARGET_TEF_SIMULATOR}-log)
63 SET(TARGET_TEF_SIMULATOR_OSAL ${TARGET_TEF_SIMULATOR}-osal)
64 SET(TARGET_TEF_SIMULATOR_DAEMON ${TARGET_TEF_SIMULATOR}-daemon)
65 SET(TARGET_TEF_SIMULATOR_SSFLIB ${TARGET_TEF_SIMULATOR}-ssflib)
66
67 # below targets need different names due to linking with CAs and TAs (libteec for client)
68 SET(TARGET_TEF_SIMULATOR_TEEC_LIB teec)
69 SET(TARGET_TEF_SIMULATOR_TEE_STUB TEEStub)
70
71 ############################# sub-project paths ###############################
72
73 # project root
74 SET(TEF_SIMULATOR_ROOT_PATH ${PROJECT_SOURCE_DIR})
75 SET(TEF_SIMULATOR_INCLUDE_PATH ${TEF_SIMULATOR_ROOT_PATH}/include)
76
77 # log
78 SET(LOG_PATH ${TEF_SIMULATOR_ROOT_PATH}/log)
79
80 # osal
81 SET(OSAL_PATH ${TEF_SIMULATOR_ROOT_PATH}/osal)
82
83 # PackageMaker
84 SET(PACKAGE_MAKER_PATH ${TEF_SIMULATOR_ROOT_PATH}/PackageMaker)
85
86 # ssflib
87 SET(SSFLIB_PATH ${TEF_SIMULATOR_ROOT_PATH}/ssflib)
88 SET(SSFLIB_DEP_PATH ${SSFLIB_PATH}/dep)
89 SET(SSFLIB_DEP_CRYPTOCORE_PATH ${SSFLIB_DEP_PATH}/cryptocore)
90 SET(SSFLIB_DEP_SWDSS_PATH ${SSFLIB_DEP_PATH}/swdss)
91 SET(SSFLIB_DEP_TIME_PATH ${SSFLIB_DEP_PATH}/time)
92 SET(SSFLIB_DEP_UCI_PATH ${SSFLIB_DEP_PATH}/uci)
93
94 # simulatordaemon
95 SET(DAEMON_PATH ${TEF_SIMULATOR_ROOT_PATH}/simulatordaemon)
96
97 # TEECLib
98 SET(TEEC_LIB_PATH ${TEF_SIMULATOR_ROOT_PATH}/TEECLib)
99
100 # TEEStub
101 SET(TEE_STUB_PATH ${TEF_SIMULATOR_ROOT_PATH}/TEEStub)
102
103 ############################# subdirectories ##################################
104
105 ADD_SUBDIRECTORY(cmake)
106 ADD_SUBDIRECTORY(log)
107 ADD_SUBDIRECTORY(osal)
108 ADD_SUBDIRECTORY(PackageMaker)
109 ADD_SUBDIRECTORY(pkgconfig)
110 ADD_SUBDIRECTORY(simulatordaemon)
111 ADD_SUBDIRECTORY(ssflib)
112 ADD_SUBDIRECTORY(TEECLib)
113 ADD_SUBDIRECTORY(TEEStub)