summaryrefslogtreecommitdiff
path: root/source/hal/CMakeLists.txt
diff options
context:
space:
mode:
authorKshitij Sisodia <kshitij.sisodia@arm.com>2022-02-23 14:40:45 +0000
committerKshitij Sisodia <kshitij.sisodia@arm.com>2022-02-23 17:34:33 +0000
commita1256e3881d1ec3e77b341dbb0c5c5dbf7ab3247 (patch)
treee0e23355a7bdbf6a62360e5391c2a3bd0763f0e3 /source/hal/CMakeLists.txt
parentfb246a834d4cb9392463f499158ca44f7e443492 (diff)
downloadml-embedded-evaluation-kit-a1256e3881d1ec3e77b341dbb0c5c5dbf7ab3247.tar.gz
MLECO-2948: Minor refactoring for platform modules.
Reducing dependency on cmsis-device sources as these will be removed under MLECO-2944. Also, starting to refactor to allow HAL to drop NPU and TA init routines - this will happen in future CRs. Added platform driver for native, and subsequent patches will attempt to get rid of the HAL "profile" specific sources and allow platform stub implementations at a level below HAL. This will allow platforms drivers to only override the range of functions that they actually want to implement and will fall back on stubs for the rest. In this CR only "utils" have been removed. Change-Id: I09b4a28e20847a07a956c818c6f47c74aab89063
Diffstat (limited to 'source/hal/CMakeLists.txt')
-rw-r--r--source/hal/CMakeLists.txt37
1 files changed, 16 insertions, 21 deletions
diff --git a/source/hal/CMakeLists.txt b/source/hal/CMakeLists.txt
index ea19de5..0d844b2 100644
--- a/source/hal/CMakeLists.txt
+++ b/source/hal/CMakeLists.txt
@@ -43,8 +43,7 @@ set(PLATFORM_PROFILE_DIR profiles/${PLATFORM_PROFILE})
target_include_directories(${HAL_TARGET}
PUBLIC
include
- ${PLATFORM_PROFILE_DIR}/timer/include
- ${PLATFORM_PROFILE_DIR}/utils/include)
+ ${PLATFORM_PROFILE_DIR}/timer/include)
## Common sources for all profiles
target_sources(${HAL_TARGET}
@@ -52,8 +51,7 @@ target_sources(${HAL_TARGET}
hal.c
${PLATFORM_PROFILE_DIR}/data_presentation/data_psn.c
${PLATFORM_PROFILE_DIR}/data_acquisition/data_acq.c
- ${PLATFORM_PROFILE_DIR}/timer/platform_timer.c
- ${PLATFORM_PROFILE_DIR}/utils/system_init.c)
+ ${PLATFORM_PROFILE_DIR}/timer/platform_timer.c)
if (DEFINED VERIFY_TEST_OUTPUT)
message(STATUS "Test output verification flag is: ${VERIFY_TEST_OUTPUT}")
@@ -61,13 +59,14 @@ if (DEFINED VERIFY_TEST_OUTPUT)
VERIFY_TEST_OUTPUT=${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)
- if (NOT DEFINED PLATFORM_DRIVERS_DIR)
- message(FATAL_ERROR "PLATFORM_DRIVERS_DIR need to be defined for this target")
- endif()
-
## Additional include directories - public
target_include_directories(${HAL_TARGET}
PUBLIC
@@ -96,15 +95,6 @@ if (PLATFORM_PROFILE STREQUAL bare-metal)
# Add dependencies for platform_driver first, in case they are needed by it.
add_subdirectory(cmsis_device ${CMAKE_BINARY_DIR}/cmsis_device)
- # Add platform-drivers target
- add_subdirectory(${PLATFORM_DRIVERS_DIR} ${CMAKE_BINARY_DIR}/platform_driver)
-
- # Link time library targets:
- target_link_libraries(${HAL_TARGET}
- PUBLIC
- log
- platform-drivers)
-
# If Ethos-U is enabled, we need the driver library too
if (ETHOS_U_NPU_ENABLED)
@@ -172,6 +162,7 @@ if (PLATFORM_PROFILE STREQUAL bare-metal)
############################ native profile #############################
elseif (PLATFORM_PROFILE STREQUAL native)
+
## Additional include directories - private
target_include_directories(${HAL_TARGET}
PRIVATE
@@ -187,12 +178,16 @@ elseif (PLATFORM_PROFILE STREQUAL native)
PUBLIC
PLATFORM_HAL=PLATFORM_UNKNOWN_LINUX_OS
ACTIVATION_BUF_SRAM_SZ=0)
+endif()
- target_link_libraries(${HAL_TARGET}
- PUBLIC
- log)
+# Add platform-drivers target
+add_subdirectory(${PLATFORM_DRIVERS_DIR} ${CMAKE_BINARY_DIR}/platform_driver)
-endif()
+# Link time library targets:
+target_link_libraries(${HAL_TARGET}
+ PUBLIC
+ log
+ platform-drivers)
# Display status:
message(STATUS "CMAKE_CURRENT_SOURCE_DIR: " ${CMAKE_CURRENT_SOURCE_DIR})