ext: open-amp: Change build integration so its not recursive
With recent changes to open-amp we can now include and build it directly as a zephyr library rather than doing a recursive make. We remove ext/lib/ipc/open-amp.cmake as part of this change and introduce a Kconfig option for open-amp. Fixes: #7673 Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
e3e8c83bd9
commit
4e8438bc0e
10 changed files with 41 additions and 40 deletions
|
@ -14,6 +14,8 @@ source "ext/lib/crypto/Kconfig"
|
|||
|
||||
source "ext/lib/encoding/Kconfig"
|
||||
|
||||
source "ext/lib/ipc/open-amp/Kconfig"
|
||||
|
||||
source "ext/lib/mgmt/Kconfig"
|
||||
|
||||
source "ext/debug/Kconfig"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
add_subdirectory(crypto)
|
||||
add_subdirectory(encoding)
|
||||
add_subdirectory(ipc)
|
||||
add_subdirectory(mgmt)
|
||||
|
|
7
ext/lib/ipc/CMakeLists.txt
Normal file
7
ext/lib/ipc/CMakeLists.txt
Normal file
|
@ -0,0 +1,7 @@
|
|||
# Copyright (c) 2018 Linaro Limited
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
add_subdirectory_ifdef(CONFIG_OPENAMP open-amp)
|
||||
|
13
ext/lib/ipc/open-amp/CMakeLists.txt
Normal file
13
ext/lib/ipc/open-amp/CMakeLists.txt
Normal file
|
@ -0,0 +1,13 @@
|
|||
#
|
||||
# Copyright (c) 2018 Linaro Limited
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
set(WITH_ZEPHYR 1)
|
||||
set(WITH_ZEPHYR_LIB 1)
|
||||
set(WITH_LIBMETAL_FIND OFF CACHE BOOL "" FORCE)
|
||||
set(LIBMETAL_INCLUDE_DIR ${ZEPHYR_BINARY_DIR}/ext/hal/libmetal/lib/include)
|
||||
set(LIBMETAL_LIB ${ZEPHYR_BINARY_DIR}/ext/hal/libmetal/lib)
|
||||
|
||||
add_subdirectory(open-amp)
|
13
ext/lib/ipc/open-amp/Kconfig
Normal file
13
ext/lib/ipc/open-amp/Kconfig
Normal file
|
@ -0,0 +1,13 @@
|
|||
#
|
||||
# Copyright (c) 2018 Linaro Limited
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
config OPENAMP
|
||||
bool
|
||||
prompt "OpenAMP Support"
|
||||
select LIBMETAL
|
||||
default n
|
||||
help
|
||||
This option enables the OpenAMP IPC library
|
|
@ -1,15 +0,0 @@
|
|||
include(ExternalProject)
|
||||
|
||||
ExternalProject_Add(
|
||||
open-amp
|
||||
SOURCE_DIR $ENV{ZEPHYR_BASE}/ext/lib/ipc/open-amp/open-amp/
|
||||
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=${ZEPHYR_BINARY_DIR}/ext/hal/libmetal/libmetal/lib/include -DLIBMETAL_LIB=${ZEPHYR_BINARY_DIR}/ext/hal/libmetal/libmetal/lib
|
||||
)
|
||||
|
||||
ExternalProject_Get_property(open-amp SOURCE_DIR)
|
||||
set(OPENAMP_INCLUDE_DIR ${SOURCE_DIR}/lib/include CACHE PATH "Path to the OpenAMP header files")
|
||||
ExternalProject_Get_property(open-amp BINARY_DIR)
|
||||
set(OPENAMP_LIBRARY ${BINARY_DIR}/lib/libopen_amp.a CACHE FILEPATH "Path to the OpenAMP library")
|
||||
|
|
@ -10,17 +10,12 @@ project(NONE)
|
|||
enable_language(C ASM)
|
||||
|
||||
# Location of external dependencies:
|
||||
set(ZEPHYR_KERNEL_LIBRARY "${CMAKE_CURRENT_BINARY_DIR}/zephyr/kernel/libkernel.a")
|
||||
set(PLATFORM_DIR "${CMAKE_CURRENT_SOURCE_DIR}/platform")
|
||||
|
||||
target_include_directories(app PRIVATE $ENV{ZEPHYR_BASE}/drivers)
|
||||
|
||||
target_sources(app PRIVATE src/main_master.c ${PLATFORM_DIR}/platform.c
|
||||
${PLATFORM_DIR}/platform_ops.c ${PLATFORM_DIR}/resource_table.c)
|
||||
|
||||
include($ENV{ZEPHYR_BASE}/ext/lib/ipc/open-amp/open-amp.cmake)
|
||||
|
||||
add_dependencies(app open-amp)
|
||||
include(ExternalProject)
|
||||
|
||||
ExternalProject_Add(
|
||||
openamp_remote
|
||||
|
@ -29,9 +24,4 @@ ExternalProject_Add(
|
|||
)
|
||||
add_dependencies(core_m0_inc_target openamp_remote)
|
||||
|
||||
target_include_directories(app PRIVATE ${OPENAMP_INCLUDE_DIR} ${PLATFORM_DIR})
|
||||
|
||||
target_link_libraries(app
|
||||
${OPENAMP_LIBRARY}
|
||||
${ZEPHYR_KERNEL_LIBRARY})
|
||||
|
||||
target_include_directories(app PRIVATE ${PLATFORM_DIR})
|
||||
|
|
|
@ -6,4 +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
|
||||
CONFIG_OPENAMP=y
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#
|
||||
set(BOARD lpcxpresso54114_m0)
|
||||
|
||||
set(ZEPHYR_KERNEL_LIBRARY "${CMAKE_CURRENT_BINARY_DIR}/zephyr/kernel/libkernel.a")
|
||||
set(PLATFORM_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../platform")
|
||||
|
||||
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
|
||||
|
@ -12,13 +11,4 @@ project(NONE)
|
|||
|
||||
target_sources(app PRIVATE src/main_remote.c ${PLATFORM_DIR}/platform.c ${PLATFORM_DIR}/resource_table.c ${PLATFORM_DIR}/platform_ops.c)
|
||||
|
||||
include($ENV{ZEPHYR_BASE}/ext/lib/ipc/open-amp/open-amp.cmake)
|
||||
|
||||
target_include_directories(app PRIVATE ${OPENAMP_INCLUDE_DIR} ${PLATFORM_DIR})
|
||||
|
||||
add_dependencies(app open-amp)
|
||||
|
||||
target_link_libraries(app
|
||||
${OPENAMP_LIBRARY}
|
||||
${ZEPHYR_KERNEL_LIBRARY})
|
||||
|
||||
target_include_directories(app PRIVATE ${PLATFORM_DIR})
|
||||
|
|
|
@ -4,4 +4,4 @@ CONFIG_IPM=y
|
|||
CONFIG_IPM_MCUX=y
|
||||
CONFIG_PLATFORM_SPECIFIC_INIT=n
|
||||
CONFIG_HEAP_MEM_POOL_SIZE=4096
|
||||
CONFIG_LIBMETAL=y
|
||||
CONFIG_OPENAMP=y
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue