blob: e0948c0f9fd38ebd96077c6ff2f11b22a09bf122 [file] [log] [blame]
Julian Hall351a0722023-01-12 11:58:42 +00001#-------------------------------------------------------------------------------
2# Copyright (c) 2023, Arm Limited and Contributors. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
Gyorgy Szing386433f2023-03-31 12:52:25 +00008include(../../deployment.cmake REQUIRED)
Julian Hall351a0722023-01-12 11:58:42 +00009
10#-------------------------------------------------------------------------------
Gyorgy Szing386433f2023-03-31 12:52:25 +000011# The CMakeLists.txt for building the fwu-tool deployment for linux-pc
Julian Hall351a0722023-01-12 11:58:42 +000012#
13# This configuration builds the FWU update agent into a command-line app
14# that can be used to apply updates to disk image files.
15#-------------------------------------------------------------------------------
16project(trusted-services LANGUAGES CXX C)
Gyorgy Szing386433f2023-03-31 12:52:25 +000017add_executable(fwu-tool)
18set(TGT "fwu-tool")
19target_include_directories(fwu-tool PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}")
Julian Hall351a0722023-01-12 11:58:42 +000020
21#-------------------------------------------------------------------------------
22# Configure trace output for command-line app
23#
24#-------------------------------------------------------------------------------
Gyorgy Szing386433f2023-03-31 12:52:25 +000025set(TRACE_PREFIX "fwu-tool" CACHE STRING "Trace prefix")
Julian Hall351a0722023-01-12 11:58:42 +000026set(TRACE_LEVEL "TRACE_LEVEL_DEBUG" CACHE STRING "Trace level")
27
28#-------------------------------------------------------------------------------
29# Deployment specific build configuration
30#
31#-------------------------------------------------------------------------------
32
33# Scale number of partitions for pretty complicated fw images
Gyorgy Szing386433f2023-03-31 12:52:25 +000034target_compile_definitions(${TGT} PRIVATE
Julian Hall351a0722023-01-12 11:58:42 +000035 PARTITIONED_BLOCK_STORE_MAX_PARTITIONS=24)
36
37#-------------------------------------------------------------------------------
38# This configuration builds for linux-pc
39#
40#-------------------------------------------------------------------------------
41include(${TS_ROOT}/environments/linux-pc/env.cmake)
Gyorgy Szing386433f2023-03-31 12:52:25 +000042add_components(TARGET ${TGT}
43 BASE_DIR ${TS_ROOT}
44 COMPONENTS "environments/linux-pc"
45)
Julian Hall351a0722023-01-12 11:58:42 +000046
47#-------------------------------------------------------------------------------
48# External project source-level dependencies
49#
50#-------------------------------------------------------------------------------
51include(${TS_ROOT}/external/tf_a/tf-a.cmake)
Gyorgy Szing386433f2023-03-31 12:52:25 +000052add_tfa_dependency(TARGET ${TGT})
Julian Hall351a0722023-01-12 11:58:42 +000053
54#-------------------------------------------------------------------------------
55# Deployment specific components
56#
57#-------------------------------------------------------------------------------
Gyorgy Szing386433f2023-03-31 12:52:25 +000058include(../fwu.cmake REQUIRED)
59include(../file-block-store.cmake REQUIRED)