Skip to content

Change libmetal to build non-recursively. #7762

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ext/hal/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
if(CONFIG_LIBMETAL)
set(WITH_ZEPHYR 1)
set(WITH_ZEPHYR_LIB 1)
set(WITH_DOC OFF CACHE BOOL "" FORCE)
set(WITH_DEFAULT_LOGGER OFF CACHE BOOL "" FORCE)
endif(CONFIG_LIBMETAL)

add_subdirectory(atmel)
add_subdirectory(cmsis)
add_subdirectory_ifdef(CONFIG_LIBMETAL libmetal)
add_subdirectory(nordic)
add_subdirectory(nxp)
add_subdirectory_if_kconfig(qmsi)
Expand Down
2 changes: 2 additions & 0 deletions ext/hal/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ source "ext/hal/altera/Kconfig"

source "ext/hal/cmsis/Kconfig"

source "ext/hal/libmetal/Kconfig"

source "ext/hal/nordic/Kconfig"

source "ext/hal/nxp/mcux/Kconfig"
Expand Down
4 changes: 4 additions & 0 deletions ext/hal/README
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ cmsis
The ARM Cortex Microcontroller Software Interface Standard (CMSIS) defines a
set of standard interfaces to ARM Cortex-M SoCs.

libmetal
--------
libmetal provides a HAL abstraction layer utilized by open-amp

gecko
-----
The Silicon Labs Gecko SDK provides device header files and peripheral drivers
Expand Down
4 changes: 2 additions & 2 deletions ext/lib/ipc/README.libmetal → ext/hal/README.libmetal
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Origin:
https://github.com/OpenAMP/libmetal

Status:
606c31438025b9fb1515dace1c642d5835d8d33c [v2018.04]
b4b5beab4b71388d63c732470b6d6da606ae8ffc

When we import libmetal we removed the tests/ and examples/ dir to reduce
the amount of code imported.
Expand All @@ -29,7 +29,7 @@ URL:
https://github.com/OpenAMP/libmetal

commit:
606c31438025b9fb1515dace1c642d5835d8d33c
b4b5beab4b71388d63c732470b6d6da606ae8ffc

Maintained-by:
External
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
cmake_minimum_required (VERSION 2.6)
if (POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
endif()

list (APPEND CMAKE_MODULE_PATH
"${CMAKE_SOURCE_DIR}/cmake"
"${CMAKE_SOURCE_DIR}/cmake/modules"
"${CMAKE_SOURCE_DIR}/cmake/platforms")
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/platforms")

include (syscheck)
project (metal C)
Expand Down
12 changes: 12 additions & 0 deletions ext/hal/libmetal/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# Copyright (c) 2018 Linaro Limited
#
# SPDX-License-Identifier: Apache-2.0
#

config LIBMETAL
bool
prompt "libmetal Support"
default n
help
This option enables the libmetal HAL abstraction layer
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ if (WITH_TESTS AND (${_host} STREQUAL ${_target}))
option (WITH_TESTS_EXEC "Run test applications during build" ON)
endif (WITH_TESTS AND (${_host} STREQUAL ${_target}))

if (WITH_ZEPHYR)
option (WITH_ZEPHYR_LIB "Build libmetal as a zephyr library" OFF)
endif (WITH_ZEPHYR)

option (WITH_DEFAULT_LOGGER "Build with default logger" ON)

option (WITH_DOC "Build with documentation" ON)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ if (WITH_ZEPHYR)
set (CMAKE_SYSTEM_NAME "Generic" CACHE STRING "")
string (TOLOWER "Zephyr" PROJECT_SYSTEM)
string (TOUPPER "Zephyr" PROJECT_SYSTEM_UPPER)
set(IS_TEST 1)
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
if (NOT WITH_ZEPHYR_LIB)
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
endif()
if (CONFIG_CPU_CORTEX_M)
set (MACHINE "cortexm" CACHE STRING "")
endif (CONFIG_CPU_CORTEX_M)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ if (WITH_ZEPHYR)
zephyr_library_named(metal)
add_dependencies(metal offsets_h)
target_sources (metal PRIVATE ${_sources})
zephyr_include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
else (WITH_ZEPHYR)
# Build a shared library if so configured.
if (WITH_SHARED_LIB)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 0 additions & 12 deletions ext/lib/ipc/libmetal.cmake

This file was deleted.

6 changes: 2 additions & 4 deletions ext/lib/ipc/open-amp.cmake
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
include(ExternalProject)

include($ENV{ZEPHYR_BASE}/ext/lib/ipc/libmetal.cmake)

ExternalProject_Add(
open-amp
SOURCE_DIR $ENV{ZEPHYR_BASE}/ext/lib/ipc/open-amp/
DEPENDS libmetal
DEPENDS metal
INSTALL_COMMAND "" # This particular build system has no install command
CMAKE_ARGS -DWITH_ZEPHYR=ON -DWITH_PROXY=OFF -DBOARD=${BOARD} -DLIBMETAL_INCLUDE_DIR=${LIBMETAL_INCLUDE_DIR} -DLIBMETAL_LIB=${LIBMETAL_LIBRARY}
CMAKE_ARGS -DWITH_ZEPHYR=ON -DWITH_PROXY=OFF -DBOARD=${BOARD} -DLIBMETAL_INCLUDE_DIR=${ZEPHYR_BINARY_DIR}/ext/hal/libmetal/lib/include -DLIBMETAL_LIB=${ZEPHYR_BINARY_DIR}/ext/hal/libmetal/lib
)

ExternalProject_Get_property(open-amp SOURCE_DIR)
Expand Down
4 changes: 1 addition & 3 deletions samples/subsys/ipc/openamp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ ExternalProject_Add(
)
add_dependencies(core_m0_inc_target openamp_remote)

target_include_directories(app PRIVATE ${LIBMETAL_INCLUDE_DIR}
${OPENAMP_INCLUDE_DIR} ${PLATFORM_DIR})
target_include_directories(app PRIVATE ${OPENAMP_INCLUDE_DIR} ${PLATFORM_DIR})

target_link_libraries(app
${OPENAMP_LIBRARY}
${LIBMETAL_LIBRARY}
${ZEPHYR_KERNEL_LIBRARY})

1 change: 1 addition & 0 deletions samples/subsys/ipc/openamp/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ CONFIG_SLAVE_IMAGE_MCUX="${ZEPHYR_BINARY_DIR}/../openamp_remote-prefix/src/opena
CONFIG_TIMESLICE_SIZE=1
CONFIG_MAIN_STACK_SIZE=2048
CONFIG_HEAP_MEM_POOL_SIZE=4096
CONFIG_LIBMETAL=y
3 changes: 1 addition & 2 deletions samples/subsys/ipc/openamp/remote/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ target_sources(app PRIVATE src/main_remote.c ${PLATFORM_DIR}/platform.c ${PLATFO

include($ENV{ZEPHYR_BASE}/ext/lib/ipc/open-amp.cmake)

target_include_directories(app PRIVATE ${LIBMETAL_INCLUDE_DIR} ${OPENAMP_INCLUDE_DIR} ${PLATFORM_DIR})
target_include_directories(app PRIVATE ${OPENAMP_INCLUDE_DIR} ${PLATFORM_DIR})

add_dependencies(app open-amp)

target_link_libraries(app
${OPENAMP_LIBRARY}
${LIBMETAL_LIBRARY}
${ZEPHYR_KERNEL_LIBRARY})

1 change: 1 addition & 0 deletions samples/subsys/ipc/openamp/remote/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ CONFIG_IPM=y
CONFIG_IPM_MCUX=y
CONFIG_PLATFORM_SPECIFIC_INIT=n
CONFIG_HEAP_MEM_POOL_SIZE=4096
CONFIG_LIBMETAL=y