blob: 37b8888f446e16e81e7659b5ec4e9128724ac34c [file] [log] [blame]
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +05301#/** @file
Jaykumar Pitambarbhai Patel03e358e2020-01-09 19:27:20 +05302# * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +05303# * SPDX-License-Identifier : Apache-2.0
4# *
5# * Licensed under the Apache License, Version 2.0 (the "License");
6# * you may not use this file except in compliance with the License.
7# * You may obtain a copy of the License at
8# *
9# * http://www.apache.org/licenses/LICENSE-2.0
10# *
11# * Unless required by applicable law or agreed to in writing, software
12# * distributed under the License is distributed on an "AS IS" BASIS,
13# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# * See the License for the specific language governing permissions and
15# * limitations under the License.
16#**/
17
18# Listing all the sources from val
19list(APPEND VAL_SRC_C_SPE
20 ${PSA_ROOT_DIR}/val/spe/val_driver_service_apis.c
21)
22
23# Listing common sources from partition
24list(APPEND PARTITION_COMMON_SRC_C_SPE
Jaykumar Pitambarbhai Patel03e358e2020-01-09 19:27:20 +053025 ${PSA_ROOT_DIR}/ff/partition/driver_partition.c
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +053026)
27
28# Listing sources from partition for client
29list(APPEND PARTITION_IPC_CLIENT_SRC_C_SPE
Jaykumar Pitambarbhai Patel03e358e2020-01-09 19:27:20 +053030 ${PSA_ROOT_DIR}/ff/partition/client_partition.c
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +053031)
32# Listing sources from partition for server
33list(APPEND PARTITION_IPC_SERVER_SRC_C_SPE
Jaykumar Pitambarbhai Patel03e358e2020-01-09 19:27:20 +053034 ${PSA_ROOT_DIR}/ff/partition/server_partition.c
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +053035)
36
37foreach(src_file ${SUITE_CC_SOURCE_SPE})
38 get_filename_component(FILE_NAME ${src_file} NAME)
39 string(SUBSTRING ${FILE_NAME} 0 9 TEST_STR)
40 if(${TEST_STR} STREQUAL "test_supp")
41 list(APPEND SUITE_SERVER_CC_SRC_SPE ${src_file})
42 else()
43 list(APPEND SUITE_CLIENT_CC_SRC_SPE ${src_file})
44 endif()
45endforeach()
46
47# Create Driver partition library
48add_library(${PSA_TARGET_DRIVER_PARTITION_LIB} STATIC ${VAL_SRC_C_SPE} ${PARTITION_COMMON_SRC_C_SPE} ${PAL_SRC_C_DRIVER_SP})
49
50# Create Client partition library
51add_library(${PSA_TARGET_CLIENT_PARTITION_LIB} STATIC ${PARTITION_IPC_CLIENT_SRC_C_SPE} ${SUITE_CLIENT_CC_SRC_SPE})
52
53# Create Server partition library
54add_library(${PSA_TARGET_SERVER_PARTITION_LIB} STATIC ${PARTITION_IPC_SERVER_SRC_C_SPE} ${SUITE_SERVER_CC_SRC_SPE})
55
56target_include_directories(${PSA_TARGET_DRIVER_PARTITION_LIB} PRIVATE
57 ${CMAKE_CURRENT_BINARY_DIR}
58 ${PSA_ROOT_DIR}/val/common
59 ${PSA_ROOT_DIR}/val/spe
Jaykumar Pitambarbhai Patel03e358e2020-01-09 19:27:20 +053060 ${PSA_ROOT_DIR}/ff/partition
Vinay Kumar Kotegowder18fcd402020-04-27 17:38:41 +053061 ${PSA_ROOT_DIR}/platform/targets/common/nspe
62 ${PSA_ROOT_DIR}/platform/targets/${TARGET}/nspe
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +053063)
64
65# Include paths from platform for driver partition build
66foreach(inc_path ${PAL_DRIVER_INCLUDE_PATHS})
67 target_include_directories(${PSA_TARGET_DRIVER_PARTITION_LIB} PRIVATE ${inc_path})
68endforeach()
69
70target_include_directories(${PSA_TARGET_CLIENT_PARTITION_LIB} PRIVATE
71 ${CMAKE_CURRENT_BINARY_DIR}
72 ${PSA_ROOT_DIR}/val/common
73 ${PSA_ROOT_DIR}/val/nspe
74 ${PSA_ROOT_DIR}/val/spe
Vinay Kumar Kotegowder18fcd402020-04-27 17:38:41 +053075 ${PSA_ROOT_DIR}/platform/targets/common/nspe
76 ${PSA_ROOT_DIR}/platform/targets/${TARGET}/nspe
Jaykumar Pitambarbhai Patel03e358e2020-01-09 19:27:20 +053077 ${PSA_ROOT_DIR}/ff/partition
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +053078)
79target_include_directories(${PSA_TARGET_SERVER_PARTITION_LIB} PRIVATE
80 ${CMAKE_CURRENT_BINARY_DIR}
81 ${PSA_ROOT_DIR}/val/common
82 ${PSA_ROOT_DIR}/val/spe
Vinay Kumar Kotegowder18fcd402020-04-27 17:38:41 +053083 ${PSA_ROOT_DIR}/platform/targets/common/nspe
84 ${PSA_ROOT_DIR}/platform/targets/${TARGET}/nspe
Jaykumar Pitambarbhai Patel03e358e2020-01-09 19:27:20 +053085 ${PSA_ROOT_DIR}/ff/partition
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +053086)
87
88# PSA Include directories
89foreach(psa_inc_path ${PSA_INCLUDE_PATHS})
90 target_include_directories(${PSA_TARGET_DRIVER_PARTITION_LIB} PRIVATE ${psa_inc_path})
91 target_include_directories(${PSA_TARGET_CLIENT_PARTITION_LIB} PRIVATE ${psa_inc_path})
92 target_include_directories(${PSA_TARGET_SERVER_PARTITION_LIB} PRIVATE ${psa_inc_path})
93endforeach()