ext: libmetal: Change build integration so its not recursive

With recent changes to libmetal we can now include and build it directly
as a zephyr library rather than doing a recursive make.  We remove
ext/hal/libmetal.cmake as part of this change and introduce a Kconfig
option for libmetal.

This is a partial fix for issue #7673.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2018-05-22 10:52:12 -05:00 committed by Kumar Gala
parent 7b09ac8446
commit c8296594df
3 changed files with 24 additions and 12 deletions

12
CMakeLists.txt Normal file
View File

@ -0,0 +1,12 @@
#
# Copyright (c) 2018 Linaro Limited
#
# SPDX-License-Identifier: Apache-2.0
#
set(WITH_ZEPHYR 1)
set(WITH_ZEPHYR_LIB 1)
set(WITH_DOC OFF CACHE BOOL "" FORCE)
set(WITH_DEFAULT_LOGGER OFF CACHE BOOL "" FORCE)
add_subdirectory(libmetal)

12
Kconfig Normal file
View File

@ -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

View File

@ -1,12 +0,0 @@
include(ExternalProject)
ExternalProject_Add(
libmetal # Name for custom target
SOURCE_DIR $ENV{ZEPHYR_BASE}/ext/hal/libmetal/libmetal/
INSTALL_COMMAND "" # This particular build system has no install command
CMAKE_ARGS -DWITH_ZEPHYR=ON -DBOARD=${BOARD} -DWITH_DEFAULT_LOGGER=OFF -DWITH_DOC=OFF
)
ExternalProject_Get_property(libmetal BINARY_DIR)
set(LIBMETAL_INCLUDE_DIR ${BINARY_DIR}/lib/include)
set(LIBMETAL_LIBRARY ${BINARY_DIR}/lib/libmetal.a)