blob: 10016c2b566e6e6c84e8d8915c0db9b23f90b877 [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
22cmake_minimum_required(VERSION 3.15.6)
23
24set(HAL_TARGET hal)
25
26project(${HAL_TARGET}
27 DESCRIPTION "HAL library"
28 LANGUAGES C CXX)
29
30# Create static library
31add_library(${HAL_TARGET} STATIC)
32
alexander31ae9f02022-02-10 16:15:54 +000033## Common include directories - public
34target_include_directories(${HAL_TARGET}
35 PUBLIC
Kshitij Sisodiada2ec062022-04-01 14:43:53 +010036 include)
alexander31ae9f02022-02-10 16:15:54 +000037
38## Common sources for all profiles
39target_sources(${HAL_TARGET}
40 PRIVATE
Kshitij Sisodiac22e80e2022-03-14 09:26:48 +000041 source/hal.c
42 source/data_psn.c
43 source/data_acq.c
Kshitij Sisodiada2ec062022-04-01 14:43:53 +010044 source/hal_timer.c)
alexander31ae9f02022-02-10 16:15:54 +000045
46if (DEFINED VERIFY_TEST_OUTPUT)
47 message(STATUS "Test output verification flag is: ${VERIFY_TEST_OUTPUT}")
48 target_compile_definitions(${HAL_TARGET} PUBLIC
49 VERIFY_TEST_OUTPUT=${VERIFY_TEST_OUTPUT})
50endif ()
51
Kshitij Sisodiaa1256e32022-02-23 14:40:45 +000052if (NOT DEFINED PLATFORM_DRIVERS_DIR)
Kshitij Sisodiac22e80e2022-03-14 09:26:48 +000053 message(FATAL_ERROR "PLATFORM_DRIVERS_DIR undefined")
alexander31ae9f02022-02-10 16:15:54 +000054endif()
55
Kshitij Sisodiad5679cc2022-03-03 16:30:07 +000056# Add platform_drivers target
Kshitij Sisodiaa1256e32022-02-23 14:40:45 +000057add_subdirectory(${PLATFORM_DRIVERS_DIR} ${CMAKE_BINARY_DIR}/platform_driver)
58
59# Link time library targets:
60target_link_libraries(${HAL_TARGET}
61 PUBLIC
Kshitij Sisodiac22e80e2022-03-14 09:26:48 +000062 log # Logging functions
63 lcd_iface # LCD interface
64 stdout_iface # Standard output (and error) interface
65 platform_drivers # Platform drivers implementing the required interfaces
66)
Kshitij Sisodiaa1256e32022-02-23 14:40:45 +000067
alexander31ae9f02022-02-10 16:15:54 +000068# Display status:
69message(STATUS "CMAKE_CURRENT_SOURCE_DIR: " ${CMAKE_CURRENT_SOURCE_DIR})
70message(STATUS "*******************************************************")
71message(STATUS "Library : " ${HAL_TARGET})
72message(STATUS "CMAKE_SYSTEM_PROCESSOR : " ${CMAKE_SYSTEM_PROCESSOR})
73message(STATUS "*******************************************************")