Kshitij Sisodia | a1256e3 | 2022-02-23 14:40:45 +0000 | [diff] [blame] | 1 | #---------------------------------------------------------------------------- |
Richard Burton | f32a86a | 2022-11-15 11:46:11 +0000 | [diff] [blame] | 2 | # SPDX-FileCopyrightText: Copyright 2022 Arm Limited and/or its affiliates <open-source-office@arm.com> |
Kshitij Sisodia | a1256e3 | 2022-02-23 14:40:45 +0000 | [diff] [blame] | 3 | # 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 | ######################################################### |
| 19 | # Native target platform support library # |
| 20 | ######################################################### |
| 21 | |
Kshitij Sisodia | 9c6f9f8 | 2022-05-20 14:30:02 +0100 | [diff] [blame] | 22 | cmake_minimum_required(VERSION 3.21.0) |
Kshitij Sisodia | a1256e3 | 2022-02-23 14:40:45 +0000 | [diff] [blame] | 23 | |
Kshitij Sisodia | d5679cc | 2022-03-03 16:30:07 +0000 | [diff] [blame] | 24 | set(PLATFORM_DRIVERS_TARGET platform_drivers) |
Kshitij Sisodia | a1256e3 | 2022-02-23 14:40:45 +0000 | [diff] [blame] | 25 | |
| 26 | project(${PLATFORM_DRIVERS_TARGET} |
| 27 | DESCRIPTION "Platform drivers library for native target" |
| 28 | LANGUAGES C CXX) |
| 29 | |
| 30 | # We should not be cross-compiling |
| 31 | if (${CMAKE_CROSSCOMPILING}) |
| 32 | message(FATAL_ERROR "Native drivers not available when cross-compiling.") |
| 33 | endif() |
| 34 | |
Kshitij Sisodia | a1256e3 | 2022-02-23 14:40:45 +0000 | [diff] [blame] | 35 | # Create static library |
| 36 | add_library(${PLATFORM_DRIVERS_TARGET} STATIC) |
| 37 | |
| 38 | ## Include directories - public |
| 39 | target_include_directories(${PLATFORM_DRIVERS_TARGET} |
| 40 | PUBLIC |
| 41 | include) |
| 42 | |
| 43 | ## Platform sources |
| 44 | target_sources(${PLATFORM_DRIVERS_TARGET} |
| 45 | PRIVATE |
Kshitij Sisodia | da2ec06 | 2022-04-01 14:43:53 +0100 | [diff] [blame] | 46 | source/platform_drivers.c |
| 47 | source/timer_native.c) |
Kshitij Sisodia | a1256e3 | 2022-02-23 14:40:45 +0000 | [diff] [blame] | 48 | |
Kshitij Sisodia | c22e80e | 2022-03-14 09:26:48 +0000 | [diff] [blame] | 49 | ## Platform component directory |
| 50 | if (NOT DEFINED COMPONENTS_DIR) |
| 51 | set(COMPONENTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../components) |
| 52 | endif() |
| 53 | |
| 54 | ## Platform component: stdout |
| 55 | set(STDOUT_RETARGET OFF CACHE BOOL "Retarget stdout/err to UART") |
| 56 | add_subdirectory(${COMPONENTS_DIR}/stdout ${CMAKE_BINARY_DIR}/stdout) |
| 57 | |
| 58 | ## Platform component: lcd |
| 59 | add_subdirectory(${COMPONENTS_DIR}/lcd ${CMAKE_BINARY_DIR}/lcd) |
| 60 | |
Kshitij Sisodia | da2ec06 | 2022-04-01 14:43:53 +0100 | [diff] [blame] | 61 | ## Platform component: PMU |
| 62 | add_subdirectory(${COMPONENTS_DIR}/platform_pmu ${CMAKE_BINARY_DIR}/platform_pmu) |
| 63 | |
Kshitij Sisodia | a1256e3 | 2022-02-23 14:40:45 +0000 | [diff] [blame] | 64 | # Add dependencies: |
Kshitij Sisodia | c22e80e | 2022-03-14 09:26:48 +0000 | [diff] [blame] | 65 | target_link_libraries(${PLATFORM_DRIVERS_TARGET} |
| 66 | PUBLIC |
| 67 | log |
Kshitij Sisodia | da2ec06 | 2022-04-01 14:43:53 +0100 | [diff] [blame] | 68 | platform_pmu |
Kshitij Sisodia | c22e80e | 2022-03-14 09:26:48 +0000 | [diff] [blame] | 69 | stdout |
| 70 | lcd_stubs) |
Kshitij Sisodia | a1256e3 | 2022-02-23 14:40:45 +0000 | [diff] [blame] | 71 | |
| 72 | # Display status: |
| 73 | message(STATUS "*******************************************************") |
| 74 | message(STATUS "Library : " ${PLATFORM_DRIVERS_TARGET}) |
| 75 | message(STATUS "CMAKE_SYSTEM_PROCESSOR : " ${CMAKE_SYSTEM_PROCESSOR}) |
Kshitij Sisodia | a1256e3 | 2022-02-23 14:40:45 +0000 | [diff] [blame] | 76 | message(STATUS "*******************************************************") |