diff options
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}) |