blob: 0435cf1a677c882ebf9bdd36e4c6083fabf79763 [file] [log] [blame]
Kshitij Sisodiaa1256e32022-02-23 14:40:45 +00001#----------------------------------------------------------------------------
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
22cmake_minimum_required(VERSION 3.15.6)
23
24set(PLATFORM_DRIVERS_TARGET platform-drivers)
25
26project(${PLATFORM_DRIVERS_TARGET}
27 DESCRIPTION "Platform drivers library for native target"
28 LANGUAGES C CXX)
29
30# We should not be cross-compiling
31if (${CMAKE_CROSSCOMPILING})
32 message(FATAL_ERROR "Native drivers not available when cross-compiling.")
33endif()
34
35
36# Create static library
37add_library(${PLATFORM_DRIVERS_TARGET} STATIC)
38
39## Include directories - public
40target_include_directories(${PLATFORM_DRIVERS_TARGET}
41 PUBLIC
42 include)
43
44## Platform sources
45target_sources(${PLATFORM_DRIVERS_TARGET}
46 PRIVATE
47 source/platform_drivers.c)
48
49# Add dependencies:
50target_link_libraries(${PLATFORM_DRIVERS_TARGET} PUBLIC log)
51
52# Display status:
53message(STATUS "*******************************************************")
54message(STATUS "Library : " ${PLATFORM_DRIVERS_TARGET})
55message(STATUS "CMAKE_SYSTEM_PROCESSOR : " ${CMAKE_SYSTEM_PROCESSOR})
56message(STATUS "*******************************************************")