Zephyr integration: Add support for POSIX architecture

When building for CMAKE_SYSTEM_PROCESSOR will be set to
"posix" which is not usefull. Let's rename it instead
to something else we can use.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
Alberto Escolar Piedras 2023-10-11 16:23:38 +02:00 committed by Carlo Caione
parent d6bedace0d
commit e0a139240a
1 changed files with 8 additions and 0 deletions

View File

@ -10,5 +10,13 @@ set(WITH_ZEPHYR_LIB 1)
set(WITH_DOC OFF CACHE BOOL "" FORCE)
set(WITH_DEFAULT_LOGGER OFF CACHE BOOL "" FORCE)
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "posix")
# When building Zephyr for the POSIX architecture
# CMAKE_SYSTEM_PROCESSOR is set to POSIX. We need
# to set it instead to "hosted" which is what the
# libmetal build specs for such a target.
set(CMAKE_SYSTEM_PROCESSOR "hosted")
endif()
add_subdirectory(${CONFIG_LIBMETAL_SRC_PATH} libmetal)
endif()