diff options
author | Kshitij Sisodia <kshitij.sisodia@arm.com> | 2022-03-14 09:26:48 +0000 |
---|---|---|
committer | Kshitij Sisodia <kshitij.sisodia@arm.com> | 2022-03-14 17:18:25 +0000 |
commit | c22e80e25521bdd291fdef9ba20194ce9d2a8544 (patch) | |
tree | b8ffe314220d4d04e84dbd6a240f77271c1e5e70 /source/hal/CMakeLists.txt | |
parent | 1716efd0b35889b580276e27c8b6f661c9858cd0 (diff) | |
download | ml-embedded-evaluation-kit-c22e80e25521bdd291fdef9ba20194ce9d2a8544.tar.gz |
MLECO-2919: Restructuring to standardise HAL APIs
* LCD module component created (removed from individual
platform packs).
* retarget.c moved out into its own component that wraps
the uart module. It also have the native stub for
GetLine => paved the way for removing data_acq module
from profiles.
* shortened names for components' dir for npu and ta
* remove peripheral_memmap and peripheral_irqs headers
from platform_drivers.h. There should be no need for
these to be included in the top level now. These should
be private headers.
* cmsis_device moved in as a component.
* Pyenv created by set_up_default_resource.py will also
install packages that CMake's source generator needs.
TODO's:
* Remove timer from profiles (MLECO-3096)
Change-Id: I9d6ea2f4f291788f40a16ed507019563c8d7f205
Diffstat (limited to 'source/hal/CMakeLists.txt')
-rw-r--r-- | source/hal/CMakeLists.txt | 66 |
1 files changed, 10 insertions, 56 deletions
diff --git a/source/hal/CMakeLists.txt b/source/hal/CMakeLists.txt index f720cdf..19f152c 100644 --- a/source/hal/CMakeLists.txt +++ b/source/hal/CMakeLists.txt @@ -37,7 +37,7 @@ else() set(PLATFORM_PROFILE native) endif() -set(PLATFORM_PROFILE_DIR profiles/${PLATFORM_PROFILE}) +set(PLATFORM_PROFILE_DIR source/profiles/${PLATFORM_PROFILE}) ## Common include directories - public target_include_directories(${HAL_TARGET} @@ -48,9 +48,9 @@ target_include_directories(${HAL_TARGET} ## Common sources for all profiles target_sources(${HAL_TARGET} PRIVATE - hal.c - ${PLATFORM_PROFILE_DIR}/data_presentation/data_psn.c - ${PLATFORM_PROFILE_DIR}/data_acquisition/data_acq.c + source/hal.c + source/data_psn.c + source/data_acq.c ${PLATFORM_PROFILE_DIR}/timer/platform_timer.c) if (DEFINED VERIFY_TEST_OUTPUT) @@ -60,56 +60,7 @@ if (DEFINED VERIFY_TEST_OUTPUT) endif () if (NOT DEFINED PLATFORM_DRIVERS_DIR) - message(FATAL_ERROR "PLATFORM_DRIVERS_DIR need to be defined for this target") -endif() - - -############################ bare-metal profile ############################# -if (PLATFORM_PROFILE STREQUAL bare-metal) - - ## Additional include directories - private - target_include_directories(${HAL_TARGET} - PRIVATE - ${PLATFORM_PROFILE_DIR}/data_presentation/lcd/include) - - ## Additional sources - public - target_sources(${HAL_TARGET} - PUBLIC - ${PLATFORM_PROFILE_DIR}/bsp/retarget.c) - - ## Additional sources - private - target_sources(${HAL_TARGET} - PRIVATE - ${PLATFORM_PROFILE_DIR}/data_presentation/lcd/lcd_img.c) - - ## Compile definition: - target_compile_definitions(${HAL_TARGET} - PUBLIC - PLATFORM_HAL=PLATFORM_CORTEX_M_BAREMETAL) - - # Add dependencies for platform_driver first, in case they are needed by it. - add_subdirectory(cmsis_device ${CMAKE_BINARY_DIR}/cmsis_device) - -############################ native profile ############################# -elseif (PLATFORM_PROFILE STREQUAL native) - - ## Additional include directories - private - target_include_directories(${HAL_TARGET} - PRIVATE - ${PLATFORM_PROFILE_DIR}/data_presentation/log/include) - - ## Additional sources - private - target_sources(${HAL_TARGET} - PRIVATE - ${PLATFORM_PROFILE_DIR}/data_presentation/log/log.c) - - ## Compile definition: - target_compile_definitions(${HAL_TARGET} - PUBLIC - PLATFORM_HAL=PLATFORM_UNKNOWN_LINUX_OS - ACTIVATION_BUF_SRAM_SZ=0) -else() - message(FATAL_ERROR "PLATFORM_PROFILE ${PLATFORM_PROFILE} not supported") + message(FATAL_ERROR "PLATFORM_DRIVERS_DIR undefined") endif() # Add platform_drivers target @@ -118,8 +69,11 @@ add_subdirectory(${PLATFORM_DRIVERS_DIR} ${CMAKE_BINARY_DIR}/platform_driver) # Link time library targets: target_link_libraries(${HAL_TARGET} PUBLIC - log - platform_drivers) + log # Logging functions + lcd_iface # LCD interface + stdout_iface # Standard output (and error) interface + platform_drivers # Platform drivers implementing the required interfaces +) # Display status: message(STATUS "CMAKE_CURRENT_SOURCE_DIR: " ${CMAKE_CURRENT_SOURCE_DIR}) |