Skip to content

Commit dce3622

Browse files
committed
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: zephyrproject-rtos#7673 Signed-off-by: Kumar Gala <[email protected]>
1 parent 05b70a4 commit dce3622

File tree

9 files changed

+36
-40
lines changed

9 files changed

+36
-40
lines changed

ext/Kconfig

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ source "ext/lib/crypto/Kconfig"
1414

1515
source "ext/lib/encoding/Kconfig"
1616

17+
source "ext/lib/ipc/open-amp/Kconfig"
18+
1719
source "ext/lib/mgmt/Kconfig"
1820

1921
source "ext/debug/Kconfig"

ext/lib/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
add_subdirectory(crypto)
22
add_subdirectory(encoding)
3+
add_subdirectory(ipc)
34
add_subdirectory(mgmt)

ext/lib/ipc/CMakeLists.txt

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright (c) 2018 Linaro Limited
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
6+
if (CONFIG_OPENAMP)
7+
set(WITH_ZEPHYR 1)
8+
set(WITH_ZEPHYR_LIB 1)
9+
set(WITH_LIBMETAL_FIND OFF CACHE BOOL "" FORCE)
10+
set(LIBMETAL_INCLUDE_DIR ${ZEPHYR_BINARY_DIR}/ext/hal/libmetal/lib/include)
11+
set(LIBMETAL_LIB ${ZEPHYR_BINARY_DIR}/ext/hal/libmetal/lib)
12+
endif(CONFIG_OPENAMP)
13+
14+
add_subdirectory_ifdef(CONFIG_OPENAMP open-amp)
15+

ext/lib/ipc/open-amp.cmake

-15
This file was deleted.

ext/lib/ipc/open-amp/Kconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#
2+
# Copyright (c) 2018 Linaro Limited
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
config OPENAMP
8+
bool
9+
prompt "OpenAMP Support"
10+
select LIBMETAL
11+
default n
12+
help
13+
This option enables the OpenAMP IPC library

samples/subsys/ipc/openamp/CMakeLists.txt

+2-12
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,12 @@ project(NONE)
1010
enable_language(C ASM)
1111

1212
# Location of external dependencies:
13-
set(ZEPHYR_KERNEL_LIBRARY "${CMAKE_CURRENT_BINARY_DIR}/zephyr/kernel/libkernel.a")
1413
set(PLATFORM_DIR "${CMAKE_CURRENT_SOURCE_DIR}/platform")
1514

16-
target_include_directories(app PRIVATE $ENV{ZEPHYR_BASE}/drivers)
17-
1815
target_sources(app PRIVATE src/main_master.c ${PLATFORM_DIR}/platform.c
1916
${PLATFORM_DIR}/platform_ops.c ${PLATFORM_DIR}/resource_table.c)
2017

21-
include($ENV{ZEPHYR_BASE}/ext/lib/ipc/open-amp.cmake)
22-
23-
add_dependencies(app open-amp)
18+
include(ExternalProject)
2419

2520
ExternalProject_Add(
2621
openamp_remote
@@ -29,9 +24,4 @@ ExternalProject_Add(
2924
)
3025
add_dependencies(core_m0_inc_target openamp_remote)
3126

32-
target_include_directories(app PRIVATE ${OPENAMP_INCLUDE_DIR} ${PLATFORM_DIR})
33-
34-
target_link_libraries(app
35-
${OPENAMP_LIBRARY}
36-
${ZEPHYR_KERNEL_LIBRARY})
37-
27+
target_include_directories(app PRIVATE ${PLATFORM_DIR})

samples/subsys/ipc/openamp/prj.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ CONFIG_SLAVE_IMAGE_MCUX="${ZEPHYR_BINARY_DIR}/../openamp_remote-prefix/src/opena
66
CONFIG_TIMESLICE_SIZE=1
77
CONFIG_MAIN_STACK_SIZE=2048
88
CONFIG_HEAP_MEM_POOL_SIZE=4096
9-
CONFIG_LIBMETAL=y
9+
CONFIG_OPENAMP=y

samples/subsys/ipc/openamp/remote/CMakeLists.txt

+1-11
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,11 @@
44
#
55
set(BOARD lpcxpresso54114_m0)
66

7-
set(ZEPHYR_KERNEL_LIBRARY "${CMAKE_CURRENT_BINARY_DIR}/zephyr/kernel/libkernel.a")
87
set(PLATFORM_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../platform")
98

109
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
1110
project(NONE)
1211

1312
target_sources(app PRIVATE src/main_remote.c ${PLATFORM_DIR}/platform.c ${PLATFORM_DIR}/resource_table.c ${PLATFORM_DIR}/platform_ops.c)
1413

15-
include($ENV{ZEPHYR_BASE}/ext/lib/ipc/open-amp.cmake)
16-
17-
target_include_directories(app PRIVATE ${OPENAMP_INCLUDE_DIR} ${PLATFORM_DIR})
18-
19-
add_dependencies(app open-amp)
20-
21-
target_link_libraries(app
22-
${OPENAMP_LIBRARY}
23-
${ZEPHYR_KERNEL_LIBRARY})
24-
14+
target_include_directories(app PRIVATE ${PLATFORM_DIR})

samples/subsys/ipc/openamp/remote/prj.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ CONFIG_IPM=y
44
CONFIG_IPM_MCUX=y
55
CONFIG_PLATFORM_SPECIFIC_INIT=n
66
CONFIG_HEAP_MEM_POOL_SIZE=4096
7-
CONFIG_LIBMETAL=y
7+
CONFIG_OPENAMP=y

0 commit comments

Comments
 (0)