Kshitij Sisodia | a1256e3 | 2022-02-23 14:40:45 +0000 | [diff] [blame] | 1 | #---------------------------------------------------------------------------- |
| 2 | # Copyright (c) 2022 Arm Limited. All rights reserved. |
| 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 | |
| 22 | cmake_minimum_required(VERSION 3.15.6) |
| 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 | |
| 35 | |
| 36 | # Create static library |
| 37 | add_library(${PLATFORM_DRIVERS_TARGET} STATIC) |
| 38 | |
| 39 | ## Include directories - public |
| 40 | target_include_directories(${PLATFORM_DRIVERS_TARGET} |
| 41 | PUBLIC |
| 42 | include) |
| 43 | |
| 44 | ## Platform sources |
| 45 | target_sources(${PLATFORM_DRIVERS_TARGET} |
| 46 | PRIVATE |
| 47 | source/platform_drivers.c) |
| 48 | |
| 49 | # Add dependencies: |
| 50 | target_link_libraries(${PLATFORM_DRIVERS_TARGET} PUBLIC log) |
| 51 | |
| 52 | # Display status: |
| 53 | message(STATUS "*******************************************************") |
| 54 | message(STATUS "Library : " ${PLATFORM_DRIVERS_TARGET}) |
| 55 | message(STATUS "CMAKE_SYSTEM_PROCESSOR : " ${CMAKE_SYSTEM_PROCESSOR}) |
| 56 | message(STATUS "*******************************************************") |