Chris Kay | fdee5cb | 2021-08-19 14:38:45 +0100 | [diff] [blame] | 1 | #[=======================================================================[.rst: |
| 2 | TFAMetadata |
| 3 | ----------- |
| 4 | |
| 5 | .. default-domain:: cmake |
| 6 | |
| 7 | Metadata management utilities for TF-A. |
| 8 | |
| 9 | TF-A uses a set of JSON-formatted metadata files to manage some of its |
| 10 | configuration data. This module provides a stable CMake interface for retrieving |
| 11 | values from these metadata files. |
| 12 | #]=======================================================================] |
| 13 | |
| 14 | include_guard() |
| 15 | |
| 16 | include(ArmAssert) |
| 17 | include(ArmExpand) |
| 18 | |
| 19 | include(TFAJsonUtilities) |
| 20 | |
| 21 | # |
| 22 | # Read the global metadata file. This is a JSON-formatted file that contains |
| 23 | # information about the contents of the repository that are relevant to the |
| 24 | # build system. |
| 25 | # |
| 26 | |
| 27 | arm_assert(CONDITION EXISTS "${CMAKE_SOURCE_DIR}/metadata.json") |
| 28 | |
| 29 | file(READ "${CMAKE_SOURCE_DIR}/metadata.json" global-metadata) |
| 30 | arm_expand(OUTPUT global-metadata STRING "${global-metadata}") |
| 31 | |
| 32 | # |
| 33 | # Internal global metadata API. |
| 34 | # |
| 35 | |
| 36 | tfa_json_getter(tfa_metadata |
| 37 | JSON "${global-metadata}") |
| 38 | |
| 39 | # |
| 40 | # External global metadata API. |
| 41 | # |