blob: 018e9705be48d5a407819b86502b5b2c5ba93a99 [file] [log] [blame]
alexander31ae9f02022-02-10 16:15:54 +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# HAL library #
20#########################################################
21
Kshitij Sisodia9c6f9f82022-05-20 14:30:02 +010022cmake_minimum_required(VERSION 3.21.0)
alexander31ae9f02022-02-10 16:15:54 +000023
24set(HAL_TARGET hal)
alexander31ae9f02022-02-10 16:15:54 +000025project(${HAL_TARGET}
26 DESCRIPTION "HAL library"
27 LANGUAGES C CXX)
28
29# Create static library
30add_library(${HAL_TARGET} STATIC)
31
alexander31ae9f02022-02-10 16:15:54 +000032## Common include directories - public
33target_include_directories(${HAL_TARGET}
34 PUBLIC
Kshitij Sisodiada2ec062022-04-01 14:43:53 +010035 include)
alexander31ae9f02022-02-10 16:15:54 +000036
37## Common sources for all profiles
38target_sources(${HAL_TARGET}
39 PRIVATE
Kshitij Sisodiac22e80e2022-03-14 09:26:48 +000040 source/hal.c
Kshitij Sisodia4cc40212022-04-08 09:54:53 +010041 source/hal_pmu.c)
alexander31ae9f02022-02-10 16:15:54 +000042
43if (DEFINED VERIFY_TEST_OUTPUT)
44 message(STATUS "Test output verification flag is: ${VERIFY_TEST_OUTPUT}")
45 target_compile_definitions(${HAL_TARGET} PUBLIC
46 VERIFY_TEST_OUTPUT=${VERIFY_TEST_OUTPUT})
47endif ()
48
Kshitij Sisodiaa1256e32022-02-23 14:40:45 +000049if (NOT DEFINED PLATFORM_DRIVERS_DIR)
Kshitij Sisodiac22e80e2022-03-14 09:26:48 +000050 message(FATAL_ERROR "PLATFORM_DRIVERS_DIR undefined")
alexander31ae9f02022-02-10 16:15:54 +000051endif()
52
Kshitij Sisodiad5679cc2022-03-03 16:30:07 +000053# Add platform_drivers target
Kshitij Sisodiaa1256e32022-02-23 14:40:45 +000054add_subdirectory(${PLATFORM_DRIVERS_DIR} ${CMAKE_BINARY_DIR}/platform_driver)
55
56# Link time library targets:
57target_link_libraries(${HAL_TARGET}
58 PUBLIC
Kshitij Sisodiac22e80e2022-03-14 09:26:48 +000059 log # Logging functions
60 lcd_iface # LCD interface
61 stdout_iface # Standard output (and error) interface
62 platform_drivers # Platform drivers implementing the required interfaces
63)
Kshitij Sisodiaa1256e32022-02-23 14:40:45 +000064
alexander31ae9f02022-02-10 16:15:54 +000065# Display status:
66message(STATUS "CMAKE_CURRENT_SOURCE_DIR: " ${CMAKE_CURRENT_SOURCE_DIR})
67message(STATUS "*******************************************************")
68message(STATUS "Library : " ${HAL_TARGET})
69message(STATUS "CMAKE_SYSTEM_PROCESSOR : " ${CMAKE_SYSTEM_PROCESSOR})
alexander31ae9f02022-02-10 16:15:54 +000070message(STATUS "*******************************************************")