1#-------------------------------------------------------------------------------
2# Copyright (c) 2023, Arm Limited and Contributors. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7if (NOT DEFINED TGT)
8	message(FATAL_ERROR "mandatory parameter TGT is not defined.")
9endif()
10
11target_sources(${TGT} PRIVATE
12	"${CMAKE_CURRENT_LIST_DIR}/restapi_env.c"
13	"${CMAKE_CURRENT_LIST_DIR}/restapi_location_strategy.c"
14	"${CMAKE_CURRENT_LIST_DIR}/restapi_service_context.c"
15	)
16
17# Configurable build parameters
18#   TS_CFG_REST_API_SERVICE_URL        URL for reaching services via REST API
19#   TS_CFG_REST_API_REACHABLE_TIMEOUT  Timeout in seconds for waiting to reach API
20if(DEFINED TS_CFG_REST_API_SERVICE_URL)
21	target_compile_definitions(${TGT} PRIVATE
22		RESTAPI_LOCATOR_API_URL=${TS_CFG_REST_API_SERVICE_URL})
23endif()
24
25if(DEFINED TS_CFG_REST_API_REACHABLE_TIMEOUT)
26	target_compile_definitions(${TGT} PRIVATE
27		RESTAPI_LOCATOR_MAX_API_WAIT=${TS_CFG_REST_API_REACHABLE_TIMEOUT})
28endif()
29